@Override
    public double read() {
        return gaugeSource.read();
    }
@Test
    public void whenNotVisitedWithCachedMetricSourceReadsDefault() {
        DoubleGaugeImplTest.SomeObject someObject = new DoubleGaugeImplTest.SomeObject();
        someObject.doubleField = 42.42D;
        metricsRegistry.registerDynamicMetricsProvider(someObject);
        DoubleGauge doubleGauge = metricsRegistry.newDoubleGauge("foo.doubleField");

        // needed to collect dynamic metrics and update the gauge created from them
        metricsRegistry.collect(mock(MetricsCollector.class));
        assertEquals(42.42D, doubleGauge.read(), 10E-6);

        // clears the cached metric source
        metricsRegistry.deregisterDynamicMetricsProvider(someObject);
        metricsRegistry.collect(mock(MetricsCollector.class));

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