DateUtil { public static Date getCurrentDate() { return new Date(); }  static Date string2Date(final String ds); static Date string2Date(final String date, final String format); static String date2String(final Date date); static String date2String(final Date date, final String format); static String getCurrentTimestamp(); static long getCurrentTime(); static Date getCurrentDate(); static int daysBetween(final Date startDate); static Date getYrMonthLastDay(final Date d); static Date getYrMonthFirstDay(final Date d); static int daysBetween(final Date startDate, final Date endDate);  }
@Test public void getCurrentDate() { Date t = DateUtil.getCurrentDate(); long s1 = t.getTime(); long s2 = System.currentTimeMillis(); Assert.isTrue(s1 - s2 < NUM_100, ErrorCodeDef.SYSTEM_ERROR_10001); }