### Question:
PercentileBuckets { public static long bucket(long v) { return BUCKET_VALUES[indexOf(v)]; } private  PercentileBuckets(); static long[] asArray(); static T[] map(Class<T> c, Function<Long, T> f); static long get(int i); static int length(); static int indexOf(long v); static long bucket(long v); static void percentiles(long[] counts, double[] pcts, double[] results); static double percentile(long[] counts, double p);  }### Answer:
@Test public void bucketSanityCheck() { Random r = new Random(42); for (int i = 0; i < 10000; ++i) { long v = r.nextLong(); if (v < 0) { Assertions.assertEquals(1, PercentileBuckets.bucket(v)); } else { long b = PercentileBuckets.bucket(v); Assertions.assertTrue(v <= b, String.format("%d > %d", v, b)); } } }