@Override
    public long read() {
        return gaugeSource.read();
    }
@Test
    public void whenCreatedForDynamicDoubleMetricWithProvidedValue() {
        SomeObject someObject = new SomeObject();
        someObject.longField = 42;
        metricsRegistry.registerDynamicMetricsProvider((tagger, context) -> context
                .collect(tagger.withPrefix("foo"), "doubleField", INFO, BYTES, 41.65D));
        LongGaugeImpl longGauge = metricsRegistry.newLongGauge("foo.doubleField");

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

        assertEquals(42, longGauge.read());
    }