CalendarBusinessDateUtils { public static LocalDate nextNonGoodBusinessDate(final LocalDate startingDate, final Calendar calendar) { LocalDate currentDate = startingDate; while (calendar.isWorkingDay(currentDate)) { currentDate = currentDate.plusDays(1); } return currentDate; }  static LocalDate nextGoodBusinessDate(final LocalDate startingDate, final Calendar calendar); static LocalDate nextNonGoodBusinessDate(final LocalDate startingDate, final Calendar calendar); static LocalDate nthGoodBusinessDate(final LocalDate startingDate, final Calendar calendar, final int numberDate); static LocalDate nthNonGoodBusinessDate(final LocalDate startingDate, final Calendar calendar, final int numberDate);  }
@Test public void nextNonGoodBusinessDate() { LocalDate startDate = LocalDate.of(2013, 12, 4); LocalDate nextNonGoodComputed = CalendarBusinessDateUtils.nextNonGoodBusinessDate(startDate, ECB); LocalDate nextNonGoodExpected = LocalDate.of(2013, 12, 11); assertEquals("CalendarBusinessDateUtils: nextNonGoodBusinessDate", nextNonGoodExpected, nextNonGoodComputed); LocalDate nextNonGoodComputed2 = CalendarBusinessDateUtils.nextNonGoodBusinessDate(nextNonGoodExpected, ECB); assertEquals("CalendarBusinessDateUtils: nextNonGoodBusinessDate", nextNonGoodExpected, nextNonGoodComputed2); }