MonthlyIMMRollDateAdjuster implements RollDateAdjuster { @Override public Temporal adjustInto(final Temporal temporal) { ArgumentChecker.notNull(temporal, "temporal"); final Temporal immDateInMonth = temporal.with(THIRD_WEDNESDAY); if (temporal.getLong(ChronoField.DAY_OF_MONTH) > immDateInMonth.getLong(ChronoField.DAY_OF_MONTH)) { return temporal.with(TemporalAdjusters.firstDayOfMonth()).plus(1L, ChronoUnit.MONTHS).with(THIRD_WEDNESDAY); } return immDateInMonth; } private  MonthlyIMMRollDateAdjuster(); static RollDateAdjuster getAdjuster(); @Override Temporal adjustInto(final Temporal temporal); @Override long getMonthsToAdjust(); @Override String getName();  }
@Test public void testFirstMonth() { LocalDate date = LocalDate.of(2013, 1, 1); final LocalDate immDate = LocalDate.of(2013, 1, 16); while (!date.isAfter(immDate)) { assertEquals(immDate, ADJUSTER.adjustInto(date)); date = date.plusDays(1); } }
@Test public void testSecondMonth() { LocalDate date = LocalDate.of(2013, 1, 17); final LocalDate immDate = LocalDate.of(2013, 2, 20); while (!date.isAfter(immDate)) { assertEquals(immDate, ADJUSTER.adjustInto(date)); date = date.plusDays(1); } }
@Test public void testThirdMonth() { LocalDate date = LocalDate.of(2013, 2, 21); final LocalDate immDate = LocalDate.of(2013, 3, 20); while (!date.isAfter(immDate)) { assertEquals(immDate, ADJUSTER.adjustInto(date)); date = date.plusDays(1); } }
@Test public void testFourthMonth() { LocalDate date = LocalDate.of(2013, 3, 21); final LocalDate immDate = LocalDate.of(2013, 4, 17); while (!date.isAfter(immDate)) { assertEquals(immDate, ADJUSTER.adjustInto(date)); date = date.plusDays(1); } }
@Test public void testFifthMonth() { LocalDate date = LocalDate.of(2013, 4, 18); final LocalDate immDate = LocalDate.of(2013, 5, 15); while (!date.isAfter(immDate)) { assertEquals(immDate, ADJUSTER.adjustInto(date)); date = date.plusDays(1); } }
@Test public void testSixthMonth() { LocalDate date = LocalDate.of(2013, 5, 16); final LocalDate immDate = LocalDate.of(2013, 6, 19); while (!date.isAfter(immDate)) { assertEquals(immDate, ADJUSTER.adjustInto(date)); date = date.plusDays(1); } }
@Test public void testSeventhMonth() { LocalDate date = LocalDate.of(2013, 6, 20); final LocalDate immDate = LocalDate.of(2013, 7, 17); while (!date.isAfter(immDate)) { assertEquals(immDate, ADJUSTER.adjustInto(date)); date = date.plusDays(1); } }
@Test public void testEighthMonth() { LocalDate date = LocalDate.of(2013, 7, 18); final LocalDate immDate = LocalDate.of(2013, 8, 21); while (!date.isAfter(immDate)) { assertEquals(immDate, ADJUSTER.adjustInto(date)); date = date.plusDays(1); } }
@Test public void testNinthMonth() { LocalDate date = LocalDate.of(2013, 8, 22); final LocalDate immDate = LocalDate.of(2013, 9, 18); while (!date.isAfter(immDate)) { assertEquals(immDate, ADJUSTER.adjustInto(date)); date = date.plusDays(1); } }
@Test public void testTenthMonth() { LocalDate date = LocalDate.of(2013, 9, 19); final LocalDate immDate = LocalDate.of(2013, 10, 16); while (!date.isAfter(immDate)) { assertEquals(immDate, ADJUSTER.adjustInto(date)); date = date.plusDays(1); } }
@Test public void testEleventhMonth() { LocalDate date = LocalDate.of(2013, 10, 17); final LocalDate immDate = LocalDate.of(2013, 11, 20); while (!date.isAfter(immDate)) { assertEquals(immDate, ADJUSTER.adjustInto(date)); date = date.plusDays(1); } }
@Test public void testTwelfthMonth() { LocalDate date = LocalDate.of(2013, 11, 21); final LocalDate immDate = LocalDate.of(2013, 12, 18); while (!date.isAfter(immDate)) { assertEquals(immDate, ADJUSTER.adjustInto(date)); date = date.plusDays(1); } }
@Test public void testYearEnd() { LocalDate date = LocalDate.of(2013, 12, 19); final LocalDate endOfYear = LocalDate.of(2013, 12, 31); final LocalDate immDate = LocalDate.of(2014, 1, 15); while(!date.isAfter(endOfYear)) { assertEquals(immDate, ADJUSTER.adjustInto(date)); date = date.plusDays(1); } }