NoopMetricsFactory implements MetricsFactory { @Override public Counter createCounter(String name, Map<String, String> tags) { return new Counter() { @Override public void inc(long delta) { } }; }  @Override Counter createCounter(String name, Map<String, String> tags); @Override Timer createTimer(final String name, final Map<String, String> tags); @Override Gauge createGauge(final String name, final Map<String, String> tags);  }
@Test public void metricNameIsUsedForCounter() { Map<String, String> tags = new HashMap<>(1); tags.put("foo", "bar"); NoopMetricsFactory metricsFactory = new NoopMetricsFactory(); metricsFactory.createCounter("thecounter", tags); }
@Test public void counterValueIsIncreased() { Map<String, String> tags = new HashMap<>(1); tags.put("foo", "bar"); NoopMetricsFactory metricsFactory = new NoopMetricsFactory(); Counter counter = metricsFactory.createCounter("thecounter", tags); counter.inc(1); }