### Question:
CodahaleMetrics implements org.apache.hadoop.hive.common.metrics.common.Metrics { @Override public Long incrementCounter(String name) { return incrementCounter(name, 1L); } CodahaleMetrics(HiveConf conf); @Override void close(); @Override void startStoredScope(String name); @Override void endStoredScope(String name); MetricsScope getStoredScope(String name); MetricsScope createScope(String name); void endScope(MetricsScope scope); @Override Long incrementCounter(String name); @Override Long incrementCounter(String name, long increment); @Override Long decrementCounter(String name); @Override Long decrementCounter(String name, long decrement); @Override void addGauge(String name, final MetricsVariable variable); @Override void addRatio(String name, MetricsVariable<Integer> numerator,
                           MetricsVariable<Integer> denominator); @Override void markMeter(String name); @VisibleForTesting MetricRegistry getMetricRegistry(); @VisibleForTesting String dumpJson(); static final Logger LOGGER; final MetricRegistry metricRegistry; }### Answer:
@Test public void testCount() throws Exception { int runs = 5; for (int i = 0; i < runs; i++) { MetricsFactory.getInstance().incrementCounter("count1"); } Counter counter = metricRegistry.getCounters().get("count1"); Assert.assertEquals(5L, counter.getCount()); }