calendar.setCapacityAt(Days.MONDAY, withNormalDuration(hours(-5)));
}
@Test
public void testCapacityOnNewVersionChangeParent() {
BaseCalendar parent1 = createBasicCalendar();
setHoursForAllDays(parent1, 8);
BaseCalendar parent2 = createBasicCalendar();
setHoursForAllDays(parent2, 4);
BaseCalendar calendar = parent1.newDerivedCalendar();
calendar.newVersion(WEDNESDAY_LOCAL_DATE);
calendar.setParent(parent2);
assertThat(calendar.getParent(), equalTo(parent2));
assertThat(calendar.getParent(MONDAY_LOCAL_DATE),
equalTo(parent1));
assertThat(calendar.getCapacityOn(wholeDay(MONDAY_LOCAL_DATE)),
equalTo(hours(8)));
assertThat(calendar.getCapacityOn(wholeDay(FRIDAY_LOCAL_DATE)),
equalTo(hours(4)));
}