ScheduledFuture<?> future = EasyMock.createMock(ScheduledFuture.class);
prepareStartTimer(service, future);
EasyMock.replay(service, future);
TimedSemaphore semaphore = new TimedSemaphore(service, PERIOD, UNIT,
LIMIT);
semaphore.acquire();
semaphore.endOfPeriod();
assertEquals("Wrong average (1)", 1.0, semaphore
.getAverageCallsPerPeriod(), .005);
semaphore.acquire();
semaphore.acquire();