IMMDateLogic { public static boolean isIndexRollDate(final LocalDate date) { if (date.getDayOfMonth() != IMM_DAY) { return false; } final int month = date.getMonthValue(); return month == INDEX_ROLL_MONTHS[0] || month == INDEX_ROLL_MONTHS[1]; }  static boolean isIMMDate(final LocalDate date); static boolean isIndexRollDate(final LocalDate date); static LocalDate[] getIMMDateSet(final LocalDate baseIMMDate, final Period[] tenors); static LocalDate[] getIMMDateSet(final LocalDate startIMMDate, final int size); static LocalDate getNextIMMDate(final LocalDate date); static LocalDate getPrevIMMDate(final LocalDate date); static LocalDate getNextIndexRollDate(final LocalDate date);  }
@Test public void isIndexRollDateTest() { LocalDate date0 = LocalDate.of(2013, 3, 14); LocalDate date1 = LocalDate.of(2013, 6, 20); LocalDate date2 = LocalDate.of(2013, 3, 20); LocalDate date3 = LocalDate.of(2013, 9, 20); assertFalse(IMMDateLogic.isIndexRollDate(date0)); assertFalse(IMMDateLogic.isIndexRollDate(date1)); assertTrue(IMMDateLogic.isIndexRollDate(date2)); assertTrue(IMMDateLogic.isIndexRollDate(date3)); }