### Question:
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();  }### Answer:
@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()); }
@Test public void testThatMetricsIsUpdated() throws Exception { timer.start(); Thread.sleep(5 * 1000); Assert.assertEquals(2, registry.getRegistry().getTimers().size()); }