@Test public void combineWarningMessages() { List<String> listOfWarningsStrings = List.of(WARNING_MESSAGE_1, WARNING_MESSAGE_2); ValidationResult warnings = ValidationResult.warnings(listOfWarningsStrings); String expectedString = StringUtils.join(listOfWarningsStrings, ", "); assertEquals(2, warnings.getWarnings().size()); assertEquals(expectedString, warnings.combineWarningMessages()); }
public String combineWarningMessages() { return combineMessages(warnings); }
ValidationResult { public String combineWarningMessages() { return combineMessages(warnings); } }
ValidationResult { public String combineWarningMessages() { return combineMessages(warnings); } private  ValidationResult(); private  ValidationResult(Collection<String> errors, Collection<String> warnings); }
ValidationResult { public String combineWarningMessages() { return combineMessages(warnings); } 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 combineWarningMessages() { return combineMessages(warnings); } 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();  }