}
Interval calculateInterval() {
List<ResourceAllocation<?>> all = getAllocationsSortedByStartDate();
if (all.isEmpty()) {
return new Interval(task.getStartDate(), task
.getEndDate());
} else {
LocalDate start = min(all.get(0)
.getStartConsideringAssignments(), all.get(0)
.getStartDate());
LocalDate taskEndDate = LocalDate.fromDateFields(task
.getEndDate());
LocalDate end = max(getEnd(all), taskEndDate);
return new Interval(asDate(start), asDate(end));
}
}