### Question:
NotNullValidator implements ConstraintValidator<NotNull, Object> { @Override public boolean isValid(Object value, ConstraintValidatorContext context) { return value != null; }  @Override boolean isValid(Object value, ConstraintValidatorContext context);  }### Answer:
@Test public void testNotNullValidator() { NotNullValidator nnv = new NotNullValidator(); assertTrue("Non null value validation must succeed", nnv.isValid("hello", null)); assertFalse("Null value validation must fail", nnv.isValid(null, null)); }