### Question:
CompositeValidator implements Validator { public void addValidators(Validator... validators) { this.validators.addAll(validators); } CompositeValidator();  CompositeValidator(Validator... validators); ObservableList<Validator> getValidators(); void addValidators(Validator... validators); void removeValidators(Validator... validators); @Override ValidationStatus getValidationStatus();  }### Answer:
@Test public void testValidation() { compositeValidator.addValidators(validator1, validator2); valid1.set(true); valid2.set(true); assertThat(status.isValid()).isTrue(); valid1.setValue(false); assertThat(status.isValid()).isFalse(); assertThat(asStrings(status.getErrorMessages())).containsOnly("error1"); assertThat(asStrings(status.getWarningMessages())).isEmpty(); assertThat(asStrings(status.getMessages())).containsOnly("error1"); valid2.setValue(false); assertThat(status.isValid()).isFalse(); assertThat(asStrings(status.getErrorMessages())).containsOnly("error1"); assertThat(asStrings(status.getWarningMessages())).containsOnly("warning2"); assertThat(asStrings(status.getMessages())).containsOnly("error1", "warning2"); valid1.setValue(true); assertThat(status.isValid()).isFalse(); assertThat(asStrings(status.getErrorMessages())).isEmpty(); assertThat(asStrings(status.getWarningMessages())).containsOnly("warning2"); assertThat(asStrings(status.getMessages())).containsOnly("warning2"); valid2.setValue(true); assertThat(status.isValid()).isTrue(); assertThat(asStrings(status.getErrorMessages())).isEmpty(); assertThat(asStrings(status.getWarningMessages())).isEmpty(); assertThat(asStrings(status.getMessages())).isEmpty(); }