@Override
    public double measure(MetricConfig config, long now) {
        purgeObsoleteSamples(config, now);
        return combine(this.samples, config, now);
    }
@Test
    @DisplayName("Sample should be kept if overlaps the window")
    public void testSampleIsKeptIfOverlaps() {
        MetricConfig config = new MetricConfig().timeWindow(1, SECONDS).samples(2);

        // Monitored window: 2s. Complete a sample and wait 1.5s after.
        completeSample(config);
        time.sleep(1500);

        double numSamples = stat.measure(config, time.milliseconds());
        assertEquals(1, numSamples);
    }