### Question:
DateUtils { public static int[] getDifference(Date startDate, Date endDate) { org.joda.time.Period interval = new org.joda.time.Period(startDate.getTime(), endDate.getTime(), org.joda.time.PeriodType.yearMonthDayTime()); return new int[]{interval.getYears(), interval.getMonths(), interval.getDays()}; }  static DateUtils getInstance(); Date[] getDateFromDateAndPeriod(Date date, Period period); Date getToday(); @NonNull static SimpleDateFormat uiDateFormat(); @NonNull static SimpleDateFormat oldUiDateFormat(); @NonNull static SimpleDateFormat timeFormat(); @NonNull static SimpleDateFormat dateTimeFormat(); @NonNull static SimpleDateFormat databaseDateFormat(); @NonNull static SimpleDateFormat databaseDateFormatNoMillis(); @NonNull static SimpleDateFormat databaseDateFormatNoSeconds(); @Nonnull static Boolean dateHasNoSeconds(String dateTime); String formatDate(Date dateToFormat); Calendar getCalendar(); void setCurrentDate(Date date); static int[] getDifference(Date startDate, Date endDate); Date expDate(@Nullable Date currentDate, int expiryDays, @Nullable PeriodType expiryPeriodType); Date getNextPeriod(PeriodType period, Date currentDate, int page); Date getNextPeriod(PeriodType period, Date currentDate, int page, boolean lastDate); String getPeriodUIString(PeriodType periodType, Date date, Locale locale); Boolean isEventExpired(@Nullable Date currentDate, Date completedDay, int compExpDays); Boolean isEventExpired(Date eventDate, Date completeDate, EventStatus status, int compExpDays, PeriodType programPeriodType, int expDays); Boolean isDataSetExpired(int expiredDays, Date periodInitialDate); Boolean isInsideInputPeriod(DataInputPeriod dataInputPeriodModel); String generateId(PeriodType periodType, Date date, Locale locale); List<DatePeriod> getDatePeriodListFor(List<Date> selectedDates, Period period); void showFromToSelector(ActivityGlobalAbstract activity, OnFromToSelector fromToListener); void showPeriodDialog(ActivityGlobalAbstract activity, OnFromToSelector fromToListener, boolean fromOtherPeriod); static Date yearsBeforeNow(int years); static Date yearsAfterNow(int years); static long timeToDate(Date finaLDate); static final String DATABASE_FORMAT_EXPRESSION; static final String DATABASE_FORMAT_EXPRESSION_NO_MILLIS; static final String DATABASE_FORMAT_EXPRESSION_NO_SECONDS; static final String DATE_TIME_FORMAT_EXPRESSION; static final String DATE_FORMAT_EXPRESSION; static final String SIMPLE_DATE_FORMAT; }### Answer:
@Test public void testGetDifference() throws ParseException { String startDateString = "2006-01-24"; String endDateString = "2019-01-23"; Date startDate = DateUtils.oldUiDateFormat().parse(startDateString); Date endDate = DateUtils.oldUiDateFormat().parse(endDateString); int[] diff = DateUtils.getDifference(startDate, endDate); assertEquals(12, diff[0]); assertEquals(11, diff[1]); assertEquals(30, diff[2]); }