StatsBuffer { public double getVariance() { return variance; } StatsBuffer(int size, double[] percentiles); void reset(); void record(long n); void computeStats(); int getCount(); double getMean(); double getVariance(); double getStdDev(); long getMin(); long getMax(); long getTotalTime(); double[] getPercentileValues(); double[] getPercentiles(); double getPercentileValueForIdx(int index);  }
@Test public void testVarianceNoWrap() { StatsBuffer buffer = getNoWrap(); assertEquals(buffer.getVariance(), 20958.5, 1e-4); }
@Test public void testVarianceWrap() { StatsBuffer buffer = getWithWrap(); assertEquals(buffer.getVariance(), EXPECTED_VARIANCE_WRAP, 1e-4); }