@Override
    public double read() {
        return gaugeSource.read();
    }
@Test
    public void whenCreatedForDynamicLongMetricWithProvidedValue() {
        DoubleGaugeImplTest.SomeObject someObject = new DoubleGaugeImplTest.SomeObject();
        someObject.longField = 42;
        metricsRegistry.registerDynamicMetricsProvider((descriptor, context) ->
                context.collect(descriptor.withPrefix("foo"), "longField", INFO, BYTES, 42));
        DoubleGauge doubleGauge = metricsRegistry.newDoubleGauge("foo.longField");

        // needed to collect dynamic metrics and update the gauge created from them
        metricsRegistry.collect(mock(MetricsCollector.class));

        assertEquals(42, doubleGauge.read(), 10E-6);
    }