@Test
public void removeZeroWeightsInSamplesToPreventNaNInMeanValues() {

    final ManualClock clock = new ManualClock();
    final ExponentiallyDecayingReservoir reservoir = new ExponentiallyDecayingReservoir(1028, 0.015, clock);
    Timer timer = new Timer(reservoir, clock);
    Context context = timer.time();
    clock.addMillis(100);
    context.stop();
    for (int i = 1; i < 48; i++) {
        clock.addHours(1);
        assertThat(reservoir.getSnapshot().getMean()).isBetween(0.0, Double.MAX_VALUE);
    }
}