### Question:
StringLengthValidator extends CustomValidator<String> { public static StringLengthValidator upTo(int max, String errorMessage) { return new StringLengthValidator(0, max, 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 upToTest() { StringLengthValidator s = StringLengthValidator.upTo(5, "test"); Assert.assertFalse(s.validate("gosjrgohgsr").getResult()); Assert.assertTrue(s.validate(" ").getResult()); Assert.assertTrue(s.validate("ae").getResult()); Assert.assertFalse(s.validate("¶æ¢¶ππ§±#").getResult()); }