### Question:
StringLengthValidator extends CustomValidator<String> { public static StringLengthValidator exactly(int value, String errorMessage) { return new StringLengthValidator(value, value, errorMessage); } private  StringLengthValidator(int min, int max, String errorMessage); static StringLengthValidator between(int min, int max, String errorMessage); static StringLengthValidator atLeast(int min, String errorMessage); static StringLengthValidator upTo(int max, String errorMessage); static StringLengthValidator exactly(int value, String errorMessage);  }### Answer:
@Test public void exactlyTest() { StringLengthValidator s = StringLengthValidator.exactly(3, "test"); Assert.assertFalse(s.validate("gfyf").getResult()); Assert.assertTrue(s.validate(" ").getResult()); Assert.assertTrue(s.validate("aee").getResult()); Assert.assertFalse(s.validate("ee").getResult()); }