ValidationUtils { public static boolean hasValidationFailures(List<ValidationResult> results) { for (ValidationResult result : results) { if (result.getValidity() == Validity.INVALID) { return true; } } return false; }  static boolean hasValidationFailures(List<ValidationResult> results); static void logValidationResults(List<ValidationResult> results); static void prefixValidationResultMessages(List<ValidationResult> results, String prefix);  }
@Test public void testHasValidationFailures() { List<ValidationResult> vrs = Lists.newArrayList( new ValidationResult(Validity.VALID, "hello"), new ValidationResult(Validity.INVALID, "world") ); assertTrue(ValidationUtils.hasValidationFailures(vrs)); }
@Test public void testHasNoValidationFailures() { List<ValidationResult> vrs = Lists.newArrayList( new ValidationResult(Validity.VALID, "hello"), new ValidationResult(Validity.VALID, "world") ); assertFalse(ValidationUtils.hasValidationFailures(vrs)); }