### Question:
DateUtil { public static String format(Date date, String pattern) { if (date == null) { return ""; } return new SimpleDateFormat(pattern).format(date); }  static Date addDate(int field, int amount); static Date addDate(Date date, int field, int amount); static String format(Date date, String pattern); static Date getDayBegin(Date date); static Date getDayBegin(); static Date getDayEnd(Date date); static Date getDayEnd(); static void setCalender(Calendar calendar, int hour, int minute, int second, int milliSecond); static boolean isBetween(Date beginTime, Date endTime);  }### Answer:
@Test public void testFormat() { Assert.assertEquals("", DateUtil.format(null, null)); Assert.assertEquals("2018-01-10:12:00:00", DateUtil.format( new Date(1_515_585_600_000L), "yyyy-MM-dd:HH:mm:ss")); }