private static OperationList assertValidationErrors(OperationList errDetails, Errors errors) {
assertEquals("Mismatched number of errors", errors.getErrorCount(), errDetails.size());
List<? extends ObjectError> errList = errors.getAllErrors();
for (int index = 0; index < errList.size(); index++) {
ObjectError expected = errList.get(index);
OperationMap actual = errDetails.get(index, OperationMap.class);
assertNotNull("Missing encoded value for error #" + index + ": " + expected, actual);
String objName = actual.get(OperationUtils.NAME_KEY, String.class);
assertEquals("Mismatched object name at entry #" + index, expected.getObjectName(), objName);
String errExpected = StringUtil.chopTailAndEllipsify(expected.toString(), ValidationJoinPointFinalizer.MAX_ERROR_TEXT_LENGTH);
String errActual = actual.get(OperationUtils.VALUE_KEY, String.class);
assertEquals("Mismatched error text at entry #" + index, errExpected, errActual);
}
return errDetails;