### Question:
CompositeValidator implements Validator { @Override public ValidationStatus getValidationStatus() { return status; } CompositeValidator();  CompositeValidator(Validator... validators); ObservableList<Validator> getValidators(); void addValidators(Validator... validators); void removeValidators(Validator... validators); @Override ValidationStatus getValidationStatus();  }### Answer:
@Test public void testValidatorConstructor() { valid1.setValue(false); valid2.setValue(false); CompositeValidator newValidator = new CompositeValidator(validator1, validator2); assertThat(newValidator.getValidationStatus().isValid()).isFalse(); assertThat(newValidator.getValidationStatus().getMessages()).hasSize(2); }
@Test public void validatorsMayNotDeleteEachOthersValidationMessages() { final StringProperty prop1 = new SimpleStringProperty(); final StringProperty prop2 = new SimpleStringProperty(); final Validator notEmpty1 = new FunctionBasedValidator<>(prop1, v -> { if (Strings.isNullOrEmpty(v)) { return ValidationMessage.error("msg"); } return null; }); final Validator notEmpty2 = new FunctionBasedValidator<>(prop2, v -> { if (Strings.isNullOrEmpty(v)) { return ValidationMessage.error("msg"); } return null; }); final CompositeValidator compositeValidator = new CompositeValidator(notEmpty1, notEmpty2); prop1.set(""); prop2.set(""); prop1.set("a"); assertThat(notEmpty1.getValidationStatus().isValid()).isTrue(); assertThat(notEmpty2.getValidationStatus().isValid()).isFalse(); assertThat(compositeValidator.getValidationStatus().isValid()).isFalse(); }