### Question:
NotEmptyValidator implements ConstraintValidator<NotEmpty, String> { public boolean isValid(String object, ConstraintValidatorContext constraintValidatorContext) { if ( object == null ) { return true; } int length = object.length(); return length > 0; }  void initialize(NotEmpty parameters); boolean isValid(String object, ConstraintValidatorContext constraintValidatorContext);  }### Answer:
@Test public void testIsValid() { assertTrue( constraint.isValid( null, null ) ); assertTrue( constraint.isValid( "foo", null ) ); assertTrue( constraint.isValid( " ", null ) ); assertFalse( constraint.isValid( "", null ) ); }