### Question:
FutureValidatorForCalendar implements ConstraintValidator<Future, Calendar> { public boolean isValid(Calendar cal, ConstraintValidatorContext constraintValidatorContext) { if ( cal == null ) { return true; } return cal.after( Calendar.getInstance() ); }  void initialize(Future constraintAnnotation); boolean isValid(Calendar cal, ConstraintValidatorContext constraintValidatorContext);  }### Answer:
@Test public void testIsValid() { Calendar futureDate = getFutureDate(); Calendar pastDate = getPastDate(); assertTrue( constraint.isValid( null, null ) ); assertTrue( constraint.isValid( futureDate, null ) ); assertFalse( constraint.isValid( pastDate, null ) ); }