StringToTime extends Date { @Override public long getTime() { return super.getTime(); } StringToTime();  StringToTime(Date date);  StringToTime(Object dateTimeString);  StringToTime(Object dateTimeString, String simpleDateFormat);  StringToTime(Object dateTimeString, Date now);  StringToTime(Object dateTimeString, Long now);  StringToTime(Object dateTimeString, Integer now);  StringToTime(Object dateTimeString, Date now, String simpleDateFormat); @Override long getTime(); Calendar getCal(); String format(String simpleDateFormat); @Override String toString(); static Object time(Object dateTimeString); static Object time(Object dateTimeString, Date now); static Object date(Object dateTimeString); static Object date(Object dateTimeString, Date now); static Object cal(Object dateTimeString); static Object cal(Object dateTimeString, Date now);  }
@Test public void testNow() { Date now = new Date(); assertEquals(new Date(now.getTime()), new StringToTime("now", now)); }