public boolean matches(Object actual) {
        if (actual == null) {
            throw new RuntimeException("the actual value can't be null");
        }
        Calendar cal = null;

        if (actual instanceof Calendar) {
            cal = (Calendar) actual;
        } else if (actual instanceof Date) {
            cal = Calendar.getInstance();
            cal.setTime((Date) actual);
        } else {
            throw new RuntimeException(
                    "the actual value must be a java.util.Date instance or a java.util.Calendar instance");
        }
        int value = cal.get(type.calendarField());
        if (type == CalendarFieldType.MONTH) {
            return expected == (value + 1);
        } else {
            return expected == value;
        }
    }