Validators { public static ValidationCallback charsetValidator() { return CHARSET_VALIDATOR; } private  Validators(); static ValidationCallback charsetValidator(); static ValidationCallback integerRangeValidator(int lowerBound, int upperBound); static ValidationCallback booleanValidator();  }
@Test public void charsetValidator() { ValidationCallback validator = Validators.charsetValidator(); assertThat(validator.validate("UTF-8")).isEmpty(); assertThat(validator.validate("ISO-8859-15")).isEmpty(); assertThat(validator.validate("foo")).isEqualTo("Unsupported charset: foo"); assertThat(validator.validate(" ")).isEqualTo("Illegal charset: "); }
@Test public void charsetValidator_single_instance() { assertThat(Validators.charsetValidator()).isSameAs(Validators.charsetValidator()); }