### Question:
DateUtils { public static void setToMaxTime(Calendar calendar) { if (calendar == null) return; calendar.set(Calendar.HOUR_OF_DAY, 23); calendar.set(Calendar.MINUTE, 59); calendar.set(Calendar.SECOND, 59); calendar.set(Calendar.MILLISECOND, 999); }  static String formatDate(Date date); static String formatCalendar2Day(Calendar calendar); static String formatDateTime(Date date); static String formatCalendar2Second(Calendar calendar); static String formatDateTime2Minute(Date date); static String formatCalendar2Minute(Calendar calendar); static String formatDateTime(Date date, String format); static String formatCalendar(Calendar calendar, String format); static int getHour(Date date); static int getMinute(Date date); static Calendar getCalendar(String dateTime); static Date getDate(String dateTime); static Date getDateEx(String dateTime); static Calendar getCalendarEx(String dateTime); static Calendar getFirstDayOfMonth(Calendar calendar); static Calendar getLastDayOfMonth(Calendar calendar); static void setToFirstDayOfMonth(Calendar calendar); static void setToLastDayOfMonth(Calendar calendar); static void setToZeroTime(Calendar calendar); @SuppressWarnings("deprecation") static void setToZeroTime(Date date); static void setToMaxTime(Calendar calendar); @SuppressWarnings("deprecation") static void setToMaxTime(Date date); static Date getZeroTimeDate(Date date); static Date getMaxTimeDate(Date date); static String getWasteTime(Date fromDate); static String getWasteTimeCN(Date fromDate); static String getWasteTime(Date startDate, Date endDate); static String getWasteTimeCN(Date startDate, Date endDate); static String getWasteTime(long wt); static String getWasteTimeCN(long wt); static float getAge(Date startDate, Date endDate); static float getAge(Calendar startDate, Calendar endDate); static float getAge(Calendar birthDate); static int[] getAgeDetail(Calendar startDate, Calendar endDate); static String getWeekCN(Calendar date); static Calendar getFirstDayOfNextMonth(Calendar calendar); static Calendar getLastDayOfNextMonth(Calendar calendar); static Calendar getDate4Range(Calendar calendar, String rangeConfig); static boolean isMonthEnd(Calendar calendar); static Map<String, String> dateFormats; }### Answer:
@Test public void testSetToMaxTime() throws ParseException { Calendar date = DateUtils.getCalendar("2011-11-01 10:20:30"); DateUtils.setToMaxTime(date); Assert.assertEquals("2011-11-01 23:59:59", formater.format(date.getTime())); }