@Test public void combineErrorMessages() { List<String> listOfErrorStrings = List.of(ERROR_MESSAGE_1, ERROR_MESSAGE_2); ValidationResult errors = ValidationResult.errors(listOfErrorStrings); String expectedString = StringUtils.join(listOfErrorStrings, ", "); assertEquals(2, errors.getErrors().size()); assertEquals(expectedString, errors.combineErrorMessages()); }
public String combineErrorMessages() { return combineMessages(errors); }
ValidationResult { public String combineErrorMessages() { return combineMessages(errors); } }
ValidationResult { public String combineErrorMessages() { return combineMessages(errors); } private  ValidationResult(); private  ValidationResult(Collection<String> errors, Collection<String> warnings); }
ValidationResult { public String combineErrorMessages() { return combineMessages(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 String combineErrorMessages() { return combineMessages(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();  }