public class TestExponentiallyDecayingSample {
@Test
public void testBasic() {
final ExponentiallyDecayingSample sample =
new ExponentiallyDecayingSample(100, 0.99);
for (int i = 0; i < 1000; i++) {
sample.update(i);
}
Assert.assertEquals(100, sample.size());
final Snapshot snapshot = sample.getSnapshot();
Assert.assertEquals(100, snapshot.size());
for (double i : snapshot.getValues()) {
Assert.assertTrue(i >= 0.0 && i < 1000.0);
}