### Question:
CodahaleMetrics 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 CodahaleTimer(metricRegistry.register(name, timer)); } CodahaleMetrics(ConfigurationProperties configurationProperties,
                           MetricRegistry metricRegistry,
                           ReservoirFactory reservoirFactory,
                           MetricsLifeCycleCallback... callbacks);  CodahaleMetrics(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() { CodahaleMetrics codahaleMetrics = new CodahaleMetrics(configurationProperties, reservoirFactory); when(reservoirFactory.newInstance(com.codahale.metrics.Timer.class, "timer")).thenReturn(reservoir); Timer timer = codahaleMetrics.timer("timer"); verify(reservoirFactory, times(1)).newInstance(com.codahale.metrics.Timer.class, "timer"); assertNotNull(timer); }