baseCalendarModel.initCreate();
baseCalendarModel.getBaseCalendar().setName("Test");
setCapacity(baseCalendarModel.getBaseCalendar(),
Capacity.create(hours(8)));
BaseCalendar parent = baseCalendarModel.getBaseCalendar();
baseCalendarModel.createNewVersion(new LocalDate().plusMonths(1), null,
null);
BaseCalendar parentNewVersion = baseCalendarModel.getBaseCalendar();
baseCalendarModel.confirmSave();
baseCalendarModel.initCreateDerived(parent);
BaseCalendar child = baseCalendarModel.getBaseCalendar();
baseCalendarModel.getBaseCalendar().setName("Derived");
baseCalendarModel.confirmSave();
baseCalendarModel.initEdit(child);
List<BaseCalendar> possibleParentCalendars = baseCalendarModel
.getPossibleParentCalendars();
assertThat(possibleParentCalendars.size(), equalTo(previous + 1));
BaseCalendar calendarComparison = null;
for (BaseCalendar calendar : possibleParentCalendars)
if (calendar.getId().equals(parentNewVersion.getId()))
calendarComparison = calendar;
assertThat(calendarComparison.getId(),
equalTo(parentNewVersion.getId()));
assertThat(calendarComparison.getCalendarDataVersions().size(),
equalTo(2));
}