### Question:
DateUtils { public static int getDaysBetween(Date date1, Date date2) { return doGetDaysBetween(date1, date2, DateUtils::anyDay); }  static List<Date> getHolidays(int year); static boolean isHoliday(Date date); static Date getNormalizedToday(); static boolean isHoliday(Calendar cal); static boolean isWeekend(Calendar cal); static Date normalizeDate(Date date); static String formatDate(Date date); static String formatDateTimestamp(Date date); static String formatCurrentTime(); static Date getDate(int year, int month, int day); static int getDaysBetween(Date date1, Date date2); static int getBusinessDaysBetween(Date date1, Date date2); static String formatDuration(long millis); static final long MS_PER_SEC; static final long MS_PER_MIN; static final long MS_PER_HOUR; static final long MS_PER_DAY; }### Answer:
@Test public void testGetDaysBetween() { long time = testDate.getTime(); int days = 3; long threeDaysOffset = days * (24 * 60 * 60 * 1000); long future = time + threeDaysOffset; Date nowDate = new Date(time); Date futureDate = new Date(future); int daysBetween = DateUtils.getDaysBetween(nowDate, futureDate); assertEquals(days, daysBetween); }
@Test public void testGetDaysBetween_SameDay() { long time = testDate.getTime(); Date date = new Date(time); int daysBetween = DateUtils.getDaysBetween(date, date); assertEquals(0, daysBetween); }
@Test public void testGetDaysBetween_MostRecentDateFirst() { long time = testDate.getTime(); int days = 3; long threeDaysOffset = days * (24 * 60 * 60 * 1000); long future = time + threeDaysOffset; Date nowDate = new Date(time); Date futureDate = new Date(future); int daysBetween = DateUtils.getDaysBetween(futureDate, nowDate); assertEquals(days, daysBetween); }