String actualDate = null;
public boolean matches(Object actual) {
if (actual == null) {
throw new JTesterException("the actual value can't be null");
}
if (actual instanceof Calendar) {
Date cal = ((Calendar) actual).getTime();
actualDate = format.format(cal);
} else if (actual instanceof Date) {
actualDate = format.format((Date) actual);
} else {
throw new JTesterException(
"the actual value must be a java.util.Date instance or a java.util.Calendar instance");
}
boolean isEqual = this.date.equals(actualDate);
return isEqual;
}