@Test
@SuppressWarnings("rawtypes")
public void accessingACustomGaugeRegistersAndReusesIt() {

    final MetricRegistry.MetricSupplier<Gauge> supplier = () -> gauge;
    final Gauge gauge1 = registry.gauge("thing", supplier);
    final Gauge gauge2 = registry.gauge("thing", supplier);
    assertThat(gauge1)
            .isSameAs(gauge2);
    verify(listener).onGaugeAdded("thing", gauge1);
}