StatsBuffer { public long getTotalTime() { return total; } 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 testTotalNoWrap() { StatsBuffer buffer = getNoWrap(); assertEquals(buffer.getTotalTime(), SIZE / 2 * (SIZE / 2 + 1) / 2); }
@Test public void testTotalWrap() { StatsBuffer buffer = getWithWrap(); assertEquals(buffer.getTotalTime(), EXPECTED_TOTAL_WRAP); }