private void givenVirtualWorkerWithCapacityAndLoad(
Capacity capacityPerDayAndUnit,
int capacityUnits,
EffortDuration load) {
VirtualWorker worker = createNiceMock(VirtualWorker.class);
expect(
worker.getAssignedDurationDiscounting(isA(Map.class),
isA(LocalDate.class))).andReturn(load)
.anyTimes();
expect(worker.getCalendar()).andReturn(
createCalendar(ResourceCalendar.class, capacityPerDayAndUnit,
capacityUnits)).anyTimes();
replay(worker);
workers.add(worker);
}