calendar.setTime(new Date());
calendar.add(Calendar.DAY_OF_MONTH, 1);
calendar.add(Calendar.YEAR, 1);
TestObjectWithCurrentDate testObject =
new TestObjectWithCurrentDate(calendar.getTime());
ValidationResult result = createMock(ValidationResult.class);
result.recordValidationViolation(
"firstDate",
"TestObjectWithCurrentDate.firstDate.dateCompare",
calendar.getTime());
replay(result);
AnnotatedObjectValidator.validate(testObject, result);