StatsBuffer { public double[] getPercentileValues() { return Arrays.copyOf(percentileValues, percentileValues.length); } 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 testPercentiles50NoWrap() { StatsBuffer buffer = getNoWrap(); double[] percentiles = buffer.getPercentileValues(); assertEquals(percentiles[0], 250.5); }
@Test public void testPercentiles95NoWrap() { StatsBuffer buffer = getNoWrap(); double[] percentiles = buffer.getPercentileValues(); assertEquals(percentiles[1], 475.95); }
@Test public void testPercentiles99NoWrap() { StatsBuffer buffer = getNoWrap(); double[] percentiles = buffer.getPercentileValues(); assertEquals(percentiles[2], 495.99); }
@Test public void testPercentiles995NoWrap() { StatsBuffer buffer = getNoWrap(); double[] percentiles = buffer.getPercentileValues(); assertEquals(percentiles[3], 498.495); }
@Test public void testPercentiles50Wrap() { StatsBuffer buffer = getWithWrap(); double[] percentiles = buffer.getPercentileValues(); assertEquals(percentiles[0], 501.0); }
@Test public void testPercentiles95Wrap() { StatsBuffer buffer = getWithWrap(); double[] percentiles = buffer.getPercentileValues(); assertEquals(percentiles[1], 951.0); }
@Test public void testPercentiles99Wrap() { StatsBuffer buffer = getWithWrap(); double[] percentiles = buffer.getPercentileValues(); assertEquals(percentiles[2], 991.0); }
@Test public void testPercentiles995Wrap() { StatsBuffer buffer = getWithWrap(); double[] percentiles = buffer.getPercentileValues(); assertEquals(percentiles[3], 996.0); }