@Test
public void testThereIsCapacityForMoreAllocations() {
assertThat(Capacity.create(hours(8)).overAssignableWithoutLimit()
.hasSpareSpaceForMoreAllocations(hours(10)), is(true));
Capacity notOverassignable = Capacity.create(hours(8))
.notOverAssignableWithoutLimit();
assertFalse(notOverassignable
.hasSpareSpaceForMoreAllocations(hours(10)));
assertTrue(notOverassignable
.hasSpareSpaceForMoreAllocations(hours(7)));
assertFalse(notOverassignable
.hasSpareSpaceForMoreAllocations(hours(8)));
Capacity withSomeExtraHours = notOverassignable
.withAllowedExtraEffort(hours(2));
assertFalse(withSomeExtraHours
.hasSpareSpaceForMoreAllocations(hours(10)));
assertTrue(withSomeExtraHours
.hasSpareSpaceForMoreAllocations(hours(7)));
assertTrue(withSomeExtraHours
.hasSpareSpaceForMoreAllocations(hours(8)));
}