HMUZAdjuster implements TemporalAdjuster { @Override public Temporal adjustInto(final Temporal temporal) { ArgumentChecker.notNull(temporal, "temporal"); LocalDate result = LocalDate.from(temporal); while (!FUTURE_EXPIRY_MONTHS.contains(result.getMonth())) { result = result.plusMonths(1); } return temporal.with(result); } private  HMUZAdjuster(); static HMUZAdjuster getInstance(); @Override Temporal adjustInto(final Temporal temporal);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullDate() { ADJUSTER.adjustInto(null); }
@Test public void test_LocalDate() { assertEquals(LocalDate.of(2012, 3, 1), ADJUSTER.adjustInto(LocalDate.of(2012, 1, 1))); assertEquals(LocalDate.of(2012, 3, 1), ADJUSTER.adjustInto(LocalDate.of(2012, 2, 1))); assertEquals(LocalDate.of(2012, 3, 1), ADJUSTER.adjustInto(LocalDate.of(2012, 3, 1))); assertEquals(LocalDate.of(2012, 6, 1), ADJUSTER.adjustInto(LocalDate.of(2012, 4, 1))); assertEquals(LocalDate.of(2012, 6, 1), ADJUSTER.adjustInto(LocalDate.of(2012, 5, 1))); assertEquals(LocalDate.of(2012, 6, 1), ADJUSTER.adjustInto(LocalDate.of(2012, 6, 1))); assertEquals(LocalDate.of(2012, 9, 1), ADJUSTER.adjustInto(LocalDate.of(2012, 7, 1))); assertEquals(LocalDate.of(2012, 9, 1), ADJUSTER.adjustInto(LocalDate.of(2012, 8, 1))); assertEquals(LocalDate.of(2012, 9, 1), ADJUSTER.adjustInto(LocalDate.of(2012, 9, 1))); assertEquals(LocalDate.of(2012, 12, 1), ADJUSTER.adjustInto(LocalDate.of(2012, 10, 1))); assertEquals(LocalDate.of(2012, 12, 1), ADJUSTER.adjustInto(LocalDate.of(2012, 11, 1))); assertEquals(LocalDate.of(2012, 12, 1), ADJUSTER.adjustInto(LocalDate.of(2012, 12, 1))); }
@Test public void test_LocalDateTime() { assertEquals(LocalDateTime.of(2012, 3, 1, 0, 0), ADJUSTER.adjustInto(LocalDateTime.of(2012, 1, 1, 0, 0))); }