if (!isPotentiallyValid(gap)) {
return AllocationSpec.invalidOn(gapOnQueue);
}
DateAndHour realStart = DateAndHour.max(earliestPossibleStart, gap
.getStartTime());
Resource resource = gapOnQueue.getOriginQueue().getResource();
List<Integer> hours = gap.getHoursInGapUntilAllocatingAndGoingToTheEnd(
resource.getCalendar(), realStart,
earliestPossibleEnd, element.getIntentedTotalHours());
int total = sum(hours);
if (total < element.getIntentedTotalHours()) {
return AllocationSpec.invalidOn(gapOnQueue);
} else if (total == element.getIntentedTotalHours()) {