@Override
public List<Interval> getEventSpaceOccupationIntervals(YearMonthDay startDateToSearch, YearMonthDay endDateToSearch) {
List<Interval> result = new ArrayList<Interval>();
OccupationPeriod occupationPeriod = getPeriod();
if (getPeriod() != null) {
result.addAll(generateEventSpaceOccupationIntervals(occupationPeriod.getStartYearMonthDay(),
occupationPeriod.getEndYearMonthDay(), getStartTimeDateHourMinuteSecond(), getEndTimeDateHourMinuteSecond(),
getFrequency(), getDayOfWeek(), getDailyFrequencyMarkSaturday(), getDailyFrequencyMarkSunday(),
startDateToSearch, endDateToSearch));
while (occupationPeriod.getNextPeriod() != null) {
result.addAll(generateEventSpaceOccupationIntervals(occupationPeriod.getNextPeriod().getStartYearMonthDay(),
occupationPeriod.getNextPeriod().getEndYearMonthDay(), getStartTimeDateHourMinuteSecond(),
getEndTimeDateHourMinuteSecond(), getFrequency(), getDayOfWeek(), getDailyFrequencyMarkSaturday(),
getDailyFrequencyMarkSunday(), startDateToSearch, endDateToSearch));
occupationPeriod = occupationPeriod.getNextPeriod();
}
}
return result;
}