Reputation: 23
Map coreAccounts = new HashMap<>();
List<Account> accounts = coreBankUserDetails.getAccounts();
//
for(int i=0;i<accounts.size();i++){
Account model = accounts.get(i);
coreAccounts.put(model.getAccountNumber(),model);
}
Upvotes: 1
Views: 81
Reputation: 72
You have to check one of accounts has null value. because the result says "Not showing null elements" and your result size is 5 and table only shows 4 element.
Upvotes: 0
Reputation: 510
if model.getAccountNumber() is Wrapper class ideally it should not be happened,there is only one possibility if HashCode is overriden and for 2 element hascode are same two object are equals then it is possible.So you should check hascode and equals method in Account class.
Upvotes: 1