### Question:
DateUtil { public static String getStringFromDate(Date dt) throws DateException { return getStringFromDate(dt, "yyyyMMdd"); }  static Date getEndDate(Date date, int amount); static Date getEndDate(Date date); static Date getStartDate(Date date, int amount); static Date getStartDate(Date date); static Date getDateFromString(String strDate); static Date getDateFromString(String strDate, String format); static String getFormat2FromStd(String date, String format); static String getFormat2FromFormat1(String date, String format1, String format2); static String getStringFromDate(Date dt); static String getStringFromDate(Date dt, String format); static int diffDate(Date dt1, Date dt2); static String getDistanceTime(String one, String two, String format); static String getDistanceTime( Date one, Date two); static int getDistanceDay(Date d1, Date d2); static int diffDate(String dt1, String dt2); static int diffDate(String dt1, String dt2, String format); static Date addDaysToDate(Date dt1, int days); static Date addHoursToDate(Date date, int hours); static Date addDaysToDate(String dt1, int days); static Date addDaysToDate(String dt1, String format, int days); static String getCurrentDate(); static String getCurrentTime(); static String getCurrentDateTime(); static String getCurrentDateTime(String format); static String getCurrentDateTime(long currentTimeMillis, String format); static String getUTCdatetimeAsString(Date date,String format); static Date getUTCdatetimeAsDate(Date date,String format); static boolean isSameDayOfWeek(Date date1, Date date2); static boolean isSameDayOfWeek(Calendar cal1, Calendar cal2); static boolean isSameDayOfMonth(Date date1, Date date2); static boolean isSameDayOfMonth(Calendar cal1, Calendar cal2); static boolean isSameMonth(Calendar cal1, Calendar cal2); static Date add(Date date, int calendarField, int amount);  }### Answer:
@Test public void testGetStringFromDate() { Calendar c = Calendar.getInstance(); c.set(2017, 5, 4); assertEquals("20170604", DateUtil.getStringFromDate(c.getTime())); }