@Test public void getErrorsTest() { ValidationResult errors = ValidationResult.errors(ERROR_MESSAGE_1); ArrayList<String> errorList = new ArrayList<>(errors.getErrors()); assertEquals(1, errorList.size()); assertEquals(ERROR_MESSAGE_1, errorList.get(0)); }
public Collection<String> getErrors() { return errors; }
ValidationResult { public Collection<String> getErrors() { return errors; } }
ValidationResult { public Collection<String> getErrors() { return errors; } private  ValidationResult(); private  ValidationResult(Collection<String> errors, Collection<String> warnings); }
ValidationResult { public Collection<String> getErrors() { return errors; } private  ValidationResult(); private  ValidationResult(Collection<String> errors, Collection<String> warnings); static ValidationResult success(); static ValidationResult errors(Collection<String> errors); static ValidationResult errors(String... errors); static ValidationResult warnings(Collection<String> warnings); static ValidationResult warnings(String... warnings); static ValidationResult of(ValidationResult... validationResults); Collection<String> getErrors(); Collection<String> getWarnings(); boolean hasErrors(); boolean hasWarnings(); String combineErrorMessages(); String combineWarningMessages(); }
ValidationResult { public Collection<String> getErrors() { return errors; } private  ValidationResult(); private  ValidationResult(Collection<String> errors, Collection<String> warnings); static ValidationResult success(); static ValidationResult errors(Collection<String> errors); static ValidationResult errors(String... errors); static ValidationResult warnings(Collection<String> warnings); static ValidationResult warnings(String... warnings); static ValidationResult of(ValidationResult... validationResults); Collection<String> getErrors(); Collection<String> getWarnings(); boolean hasErrors(); boolean hasWarnings(); String combineErrorMessages(); String combineWarningMessages();  }