NoopMeterRegistry extends MeterRegistry { @Override protected <T> FunctionTimer newFunctionTimer(Meter.Id id, T obj, ToLongFunction<T> countFunction, ToDoubleFunction<T> totalTimeFunction, TimeUnit totalTimeFunctionUnit) { return new NoopFunctionTimer(id); } NoopMeterRegistry(); private  NoopMeterRegistry(Clock clock);   }
@Test public void newFunctionTimer_createsNoopFunctionTimer() { Id expectedId = new Id("name", Tags.of("key", "value"), null, null, TIMER); FunctionTimer result = noopMeterRegistry.newFunctionTimer(expectedId, new Object(), x -> 0L, x -> 0.0, SECONDS); assertThat(result) .isInstanceOf(NoopFunctionTimer.class); assertThat(result.getId()) .isEqualTo(expectedId); }