@Override
    public double read() {
        return gaugeSource.read();
    }
@Test
    public void whenCreatedForDynamicLongMetricWithExtractedValue() {
        SomeObject someObject = new SomeObject();
        someObject.longField = 42;
        metricsRegistry.registerDynamicMetricsProvider(someObject);
        DoubleGauge doubleGauge = metricsRegistry.newDoubleGauge("foo.longField");

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

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

        someObject.longField = 43;
        assertEquals(43D, doubleGauge.read(), 10E-6);
    }