@Test public void testThatTasksRunCorrectNumberOfTimes() throws Exception { timer.start(); Thread.sleep(5 * 1000); Assert.assertEquals(3, sensing.get(TASK1).size()); Assert.assertEquals(2, sensing.get(TASK2).size()); }
public void start() { executor.execute(this::process); }
Timer { public void start() { executor.execute(this::process); } }
Timer { public void start() { executor.execute(this::process); } Timer(String name, MetricsRegistry registry); }
Timer { public void start() { executor.execute(this::process); } Timer(String name, MetricsRegistry registry); void add(String name, Runnable runnable, int seconds, Date nextRun); void add(String name, Runnable runnable, int seconds); void remove(String name); Collection<String> list(); void pause(); void resume(); void stop(); void start(); }
Timer { public void start() { executor.execute(this::process); } Timer(String name, MetricsRegistry registry); void add(String name, Runnable runnable, int seconds, Date nextRun); void add(String name, Runnable runnable, int seconds); void remove(String name); Collection<String> list(); void pause(); void resume(); void stop(); void start();  }