Histogram { public static Histogram linear(double start, double width, int numBuckets) { return new Histogram(LinearBuckets.of(start, width, numBuckets)); } private  Histogram(BucketType bucketType); static Histogram linear(double start, double width, int numBuckets); void record(double... values); synchronized void clear(); synchronized void record(double value); synchronized long getTotalCount(); synchronized long getCount(int bucketIndex); double p99(); double p90(); double p50();  }
@Test public void testEmptyP99() { Histogram histogram = Histogram.linear(0, 0.2, 50); assertThrows(RuntimeException.class, histogram::p99); }