IMMDateLogic { public static boolean isIMMDate(final LocalDate date) { if (date.getDayOfMonth() != IMM_DAY) { return false; } if ((date.getMonthValue() % 3) != 0) { return false; } return true; }  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 void isIMMTest() { LocalDate date = LocalDate.of(2013, Month.MARCH, 20); assertTrue(isIMMDate(date)); date = LocalDate.of(2013, Month.APRIL, 20); assertFalse(isIMMDate(date)); date = LocalDate.of(2013, Month.DECEMBER, 23); assertFalse(isIMMDate(date)); }