CalendarUtils { public static boolean isStartOfDecade(Calendar calendar) { Calendar temp = (Calendar) calendar.clone(); temp.add(Calendar.MILLISECOND, -1); return decade(temp.get(Calendar.YEAR)) != decade(calendar.get(Calendar.YEAR)); }  static void add(Calendar calendar, int field, int amount); static int get(Calendar calendar, int field); static void set(Calendar calendar, int field, int value); static Date getEndOfDST(Calendar calendar); static Date getStartOfDST(Calendar calendar); static boolean isStartOfDay(Calendar calendar); static boolean isEndOfDay(Calendar calendar); static boolean isStartOfMonth(Calendar calendar); static boolean isEndOfMonth(Calendar calendar); static boolean isStartOfWeek(Calendar calendar); static boolean isEndOfWeek(Calendar calendar); static void startOfWeek(Calendar calendar); static void endOfWeek(Calendar calendar); static Date endOfWeek(Calendar calendar, Date date); static Date startOfWeek(Calendar calendar, Date date); static void startOfDecade(Calendar calendar); static Date startOfDecade(Calendar calendar, Date date); static boolean isStartOfDecade(Calendar calendar); static void startOfYear(Calendar calendar); static Date startOfYear(Calendar calendar, Date date); static boolean isStartOfYear(Calendar calendar); static void startOfMonth(Calendar calendar); static void endOfMonth(Calendar calendar); static Date startOfDay(Calendar calendar, Date date); static Date endOfDay(Calendar calendar, Date date); static void startOfDay(Calendar calendar); static void endOfDay(Calendar calendar); static void startOf(Calendar calendar, int field); static boolean isStartOf(Calendar calendar, int field); static boolean areEqual(Date current, Date date); static boolean isSameDay(Calendar today, Date now); static boolean isSame(Calendar today, Date now, int field); static boolean isFlushed(Calendar calendar); @SuppressWarnings("unused")
    static final int ONE_MINUTE; @SuppressWarnings("unused")
    static final int ONE_HOUR; @SuppressWarnings("unused")
    static final int THREE_HOURS; @SuppressWarnings("unused")
    static final int ONE_DAY; static final int DECADE; static final int YEAR_IN_DECADE; }
@Test public void testIsStartOfDecade() { todayGerman.set(Calendar.YEAR, 2000); CalendarUtils.startOfYear(todayGerman); assertTrue(CalendarUtils.isStartOfDecade(todayGerman)); todayGerman.add(Calendar.YEAR, 1); assertFalse(CalendarUtils.isStartOfDecade(todayGerman)); }