Set<Criterion> criteria, DateAndHour gapStartTime,
DateAndHour gapEndTime) {
AvailabilityTimeLine criterionsAvailability = AvailabilityCalculator
.getCriterionsAvailabilityFor(criteria, resource);
if (gapStartTime != null) {
criterionsAvailability.invalidUntil(gapStartTime.getDate());
}
if (gapEndTime != null) {
criterionsAvailability.invalidFrom(gapEndTime.getDate());
}
List<Interval> validPeriods = criterionsAvailability.getValidPeriods();