NoopMeterRegistry extends MeterRegistry { @Override protected <T> FunctionCounter newFunctionCounter(Meter.Id id, T obj, ToDoubleFunction<T> countFunction) { return new NoopFunctionCounter(id); } NoopMeterRegistry(); private  NoopMeterRegistry(Clock clock);   }
@Test public void newFunctionCounter_createsNoopFunctionCounter() { Id expectedId = new Id("name", Tags.of("key", "value"), null, null, COUNTER); FunctionCounter result = noopMeterRegistry.newFunctionCounter(expectedId, new Object(), x -> 0.0); assertThat(result) .isInstanceOf(NoopFunctionCounter.class); assertThat(result.getId()) .isEqualTo(expectedId); }