### Question:
DropwizardMetrics extends AbstractMetrics { @Override public Timer timer(String name) { com.codahale.metrics.Timer timer = new com.codahale.metrics.Timer( reservoirFactory.newInstance(com.codahale.metrics.Timer.class, name) ); return new DropwizardTimer(metricRegistry.register(name, timer)); } DropwizardMetrics(ConfigurationProperties configurationProperties,
                             MetricRegistry metricRegistry,
                             ReservoirFactory reservoirFactory,
                             MetricsLifeCycleCallback... callbacks);  DropwizardMetrics(ConfigurationProperties configurationProperties,
                             ReservoirFactory reservoirFactory,
                             MetricsLifeCycleCallback... callbacks); @Override Histogram histogram(String name); @Override Timer timer(String name); void start(); void stop(); static final MetricsFactory FACTORY; static final MetricsFactory UNIFORM_RESERVOIR_FACTORY; }### Answer:
@Test public void testTimer() { DropwizardMetrics dropwizardMetrics = new DropwizardMetrics(configurationProperties, reservoirFactory); when(reservoirFactory.newInstance(com.codahale.metrics.Timer.class, "timer")).thenReturn(reservoir); Timer timer = dropwizardMetrics.timer("timer"); verify(reservoirFactory, times(1)).newInstance(com.codahale.metrics.Timer.class, "timer"); assertNotNull(timer); }