StringToTime extends Date { public static Object date(Object dateTimeString) { return date(dateTimeString, new Date()); } 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 testNowPlus2Days() throws Exception { final Date date = (Date) StringToTime.date("now +2 days"); assertThat(date).isAfter(new Date()); }
@Test public void testNowPlus2DaysWithSpace() throws Exception { final Date date = (Date) StringToTime.date("now + 2 days"); assertThat(date).isAfter(new Date()); }