PolishHolidays implements Holidays { @Override public LocalDate nextHolidayAfter(LocalDate date) { LocalDate cur = date; do { cur = cur.plusDays(1); } while(isWorkingDay(cur)); return cur; }  boolean isHoliday(LocalDate date); @Override boolean isWorkingDay(LocalDate date); @Override LocalDate nextHolidayAfter(LocalDate date); @Override LocalDate nextWorkingDayAfter(LocalDate date);  }
@Test public void shouldFindNextHoliday() { assertThat(holidays.nextHolidayAfter(LocalDate.of(2014, APRIL, 24))).isEqualTo(LocalDate.of(2014, APRIL, 26)); assertThat(holidays.nextHolidayAfter(LocalDate.of(2014, APRIL, 25))).isEqualTo(LocalDate.of(2014, APRIL, 26)); assertThat(holidays.nextHolidayAfter(LocalDate.of(2014, APRIL, 26))).isEqualTo(LocalDate.of(2014, APRIL, 27)); assertThat(holidays.nextHolidayAfter(LocalDate.of(2014, APRIL, 28))).isEqualTo(LocalDate.of(2014, MAY, 1)); assertThat(holidays.nextHolidayAfter(LocalDate.of(2014, MAY, 1))).isEqualTo(LocalDate.of(2014, MAY, 3)); }