Histogram extends BaseMeter { public Histogram(MeterId meterId, List<Double> steps) { super(meterId); this.buckets = initBuckets(steps); } Histogram(MeterId meterId, List<Double> steps); void addValue(double value); @Override MeterData.Builder transform();  }
@Test public void testBuckets() { final MeterId meterId = new MeterId("test", MeterType.COUNTER, Arrays.asList(new MeterTag("k1", "v1"))); final Histogram histogram = MeterFactory.histogram("test").steps(Arrays.asList(2d, 5d)).minValue(2d).build(); final Histogram.Bucket[] buckets = (Histogram.Bucket[]) Whitebox.getInternalState(histogram, "buckets"); Assert.assertEquals(2, buckets.length); Assert.assertEquals(buckets[0], new Histogram.Bucket(2)); Assert.assertEquals(buckets[1], new Histogram.Bucket(5)); }