class CalendarService {

	public Date getNextLaboralDay(final Date date, final int days, final HolidayCalendar calendar) {
		DateTime tmp = new DateTime(date);
		// Note: in the case of previous dates we want to have an offset
		int check = days < 0 ? Math.abs(days) - 1 : days;
		int count = 0;
		int increment = days < 0 ? -1 : 1;
		do {
			if (!isLaboralDay(tmp.toDate(), calendar)) {
				tmp = tmp.plusDays(increment);
				continue;
			}
			tmp = tmp.plusDays(increment);
			count++;
		}
		while (count < check);
		return tmp.toDate();
	}

}

class CalendarServiceTest {

	@Test
	public void test02() {

		CalendarService service = new CalendarService();
		DateTime dt = new DateTime(2017, 10, 1, 0, 0, 0);
		Date result = service.getNextLaboralDay(dt.toDate(), 0, null);
		DateTime dtResult = new DateTime(result);

		Assert.assertEquals(2017, dtResult.getYear());
		Assert.assertEquals(10, dtResult.getMonthOfYear());
		Assert.assertEquals(2, dtResult.getDayOfMonth());
	}

}