ScheduledReporter implements Closeable { public void report() { synchronized (this) { report(registry.allMetrics().entrySet()); } } protected  ScheduledReporter(MetricsRegistry registry, String name, TimeUnit rateUnit, TimeUnit durationUnit); protected  ScheduledReporter(MetricsRegistry registry, TimeUnit rateUnit, TimeUnit durationUnit,
      ScheduledExecutorService executor); void start(long period, TimeUnit unit); void stop(); @Override void close(); void report(); abstract void report(Set<Entry<MetricName, Metric>> metrics);  }
@Test public void pollsPeriodically() throws Exception { Thread.sleep(500); verify(reporter, times(2)).report(set(list)); }