### Question:
SelectionLengthValidator extends CustomValidator<ObservableList<E>> { public static <T> SelectionLengthValidator<T> exactly(int value, String errorMessage) { return new SelectionLengthValidator<>(value, value, errorMessage); } private  SelectionLengthValidator(int min, int max, String errorMessage); static SelectionLengthValidator<T> between(int min, int max, String errorMessage); static SelectionLengthValidator<T> atLeast(int min, String errorMessage); static SelectionLengthValidator<T> upTo(int max, String errorMessage); static SelectionLengthValidator<T> exactly(int value, String errorMessage);  }### Answer:
@Test public void exactlyTest() { SelectionLengthValidator<Integer> s = SelectionLengthValidator.exactly(2, "test"); Assert.assertFalse(s.validate(FXCollections.observableArrayList(1, 2, 3)).getResult()); Assert.assertTrue(s.validate(FXCollections.observableArrayList(1, 2)).getResult()); Assert.assertFalse(s.validate(FXCollections.observableArrayList()).getResult()); Assert.assertFalse(s.validate(FXCollections.observableArrayList(1)).getResult()); }