assertTrue(timeLine.isValid(intervalEnd.plusDays(4)));
}
@Test
public void addingAnIntervalThatJoinsTwoInvalidIntervals() {
AvailabilityTimeLine timeLine = AvailabilityTimeLine.allValid();
LocalDate intervalStart = contemporaryExample.minusDays(10);
LocalDate intervalEnd = contemporaryExample.plusDays(5);
timeLine.invalidAt(intervalStart, intervalEnd);
timeLine.invalidAt(intervalStart.minusDays(20), intervalStart
.minusDays(10));
timeLine.invalidAt(intervalStart.minusDays(10), intervalStart);
LocalDate current = intervalStart.minusDays(20);
while (current.isBefore(intervalEnd)) {
assertFalse(timeLine.isValid(current));
current = current.plusDays(1);
}
}