assertEqual(annuity.getPayouts(), results.getPayouts(),
"Annuity payouts from Client is not equal to DB value", "Mismacth was found in number of payouts");
boolean found = false;
if (annuity.getPayouts() != null) {
IPayout clientPayout = null;
for (int i=0; i<annuity.getPayouts().size(); i++) {
found = false; // reset
clientPayout = annuity.getPayouts().get(i);
for (IPayout resultPayout: results.getPayouts()) {
if (clientPayout.getId().equals(resultPayout.getId())){
found = true;
assertEqual(clientPayout, resultPayout,
"Annuity Payout from Client is not equal to DB value at location: " +i , "Mismacth was found");
}else{
continue;
}
}
if (!(found) && clientPayout != null) {
throw new RuntimeException("Annuity: Payout from client is not equal to DB. " +
"Found Payout with id: " + clientPayout.getId() +
" on the client side, but not in the database for annuity id:" + annuity.getId());
}
}
}