@Test
public void accessingACustomCounterRegistersAndReusesTheCounter() {

    final MetricRegistry.MetricSupplier<Counter> supplier = () -> counter;
    final Counter counter1 = registry.counter("thing", supplier);
    final Counter counter2 = registry.counter("thing", supplier);
    assertThat(counter1)
            .isSameAs(counter2);
    verify(listener).onCounterAdded("thing", counter1);
}