Skip to content

Instantly share code, notes, and snippets.

@khaosans
Created February 19, 2016 20:59
Show Gist options
  • Save khaosans/280950dcdfd8c6c735cc to your computer and use it in GitHub Desktop.
Save khaosans/280950dcdfd8c6c735cc to your computer and use it in GitHub Desktop.
change this to a stream
private void compareDocs(Map<String, Object> responseMap, List<IndexField> listOfIndexFields, VerificationResponse verificationFailureResponse) {
for (int i = 0; i < listOfIndexFields.size(); ++i) {
@SuppressWarnings("unchecked") //Indexed are always object lists
ArrayList<Object> value = (ArrayList<Object>) responseMap.get(listOfIndexFields.get(i).getFieldName());
if (!listOfIndexFields.get(i).getFieldValues()[0].equals(value.get(0))) {
MisMatchFields misMatchFields = new MisMatchFields(value.get(i).toString(), listOfIndexFields.get(i).getFieldValues()[0]);
misMatchFields.setField(listOfIndexFields.get(i).getFieldName());
verificationFailureResponse.addToListOfMisMatchedFields(misMatchFields);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment