### Question:
Histogram { public Histogram(long[] buckets, double start, double end) { this.buckets = buckets; this.start = start; this.end = end; } Histogram(long[] buckets, double start, double end); double getStart(); double getEnd(); long[] getBuckets(); long getSum(); double getBucketSize(); double[] getBucketRange(int index); double getValueAt(double ratio);  }### Answer:
@Test public void histogramTest(){ final Histogram histo = new Histogram(new long[]{1,2,3,4,5,5,4,3,2,1}, 2.0, 12.0); assertEquals(2.0, histo.getStart(), DELTA); assertEquals(12.0, histo.getEnd(), DELTA); assertEquals(30, histo.getSum()); assertEquals(1.0, histo.getBucketSize(), DELTA); assertArrayEquals(new double[]{5.0,6.0}, histo.getBucketRange(3),DELTA); assertEquals(2.0, histo.getValueAt(0),DELTA); assertEquals(12.0, histo.getValueAt(1),DELTA); assertEquals(7.0, histo.getValueAt(0.5),DELTA); assertEquals(3.5, histo.getValueAt(2.0/30.0),DELTA); }