StatsBuffer { public double getMean() { return mean; } 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 testMeanNoWrap() { StatsBuffer buffer = getNoWrap(); assertEquals(buffer.getMean(), SIZE / 4.0); }
@Test public void testMeanWrap() { StatsBuffer buffer = getWithWrap(); assertEquals(buffer.getMean(), (double) EXPECTED_TOTAL_WRAP / SIZE); }