### Question:
DateUtils { public static long toDays(Date date) { return toDays(date.getTime() + TimeZone.getDefault().getRawOffset()); }  static boolean isSameDay(final Date date1, final Date date2); static boolean isSameDay(final Calendar cal1, final Calendar cal2); static boolean isSameWeek(final Date date1, final Date date2); static boolean isSameWeek(Calendar cal1, Calendar cal2); static boolean isSameMonth(final Date date1, final Date date2); static boolean isSameMonth(Calendar cal1, Calendar cal2); static Date addYears(final Date date, final int amount); static Date addMonths(final Date date, final int amount); static Date addWeeks(final Date date, final int amount); static Date addDays(final Date date, final int amount); static Date addHours(final Date date, final int amount); static Date addMinutes(final Date date, final int amount); static Date addSeconds(final Date date, final int amount); static Date addMilliseconds(final Date date, final int amount); static long toSeconds(Date date); static long toSeconds(long milliseconds); static long toSecondsByStartOfDay(LocalDate localDate); static long toDays(Date date); static long toDays(long milliseconds); static long diffSeconds(Date date1, Date date2); static long diffDays(Date date1, Date date2); static String formatTime(long seconds); static final int MILLISECOND_PER_SECOND; static final int SECOND_PER_MINUTE; static final int MINUTE_PER_HOUR; static final int HOUR_PER_DAY; }### Answer:
@Test public void testToDays() throws ParseException { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS"); { Date d1 = sdf.parse("2018-12-31 00:00:00:990"); Date d2 = sdf.parse("2018-12-31 23:59:59:001"); assertTrue(17896 == DateUtils.toDays(d1)); assertTrue(17896 == DateUtils.toDays(d2)); } { Date d1 = sdf.parse("2019-01-01 00:00:00:000"); Date d2 = sdf.parse("2019-01-01 23:59:59:999"); assertTrue(17897 == DateUtils.toDays(d1)); assertTrue(17897 == DateUtils.toDays(d2)); } }