assertEquals(200D, calc0.getMean(), 10D);
}
@Test
public void testEventDurationCalculator1() throws InterruptedException {
EventDurationCalculator calc0 = new EventDurationCalculator();
long start = System.nanoTime();
calc0.eventStarted();
Thread.sleep(300);
calc0.eventStarted();
Thread.sleep(600);
calc0.eventStarted();
Thread.sleep(100);
calc0.eventEnded();
Thread.sleep(400);
calc0.eventEnded();
Thread.sleep(200);
calc0.eventEnded();
long end = System.nanoTime();
assertEquals(1600D, (end - start) / 1e6, 10D);
assertEquals(933D, calc0.getMean(), 10D);
}