Histogram implements Iterable<Integer> { public int get(int binIndex) { return bins[binIndex]; } Histogram(Iterable<Comparable<?>> data, int binCount);  Histogram(Iterable<Comparable<?>> data, Number... breaks); int size(); int get(int binIndex); @Override Iterator<Integer> iterator();  }
@Test public void testGetReturnsBinSize() { Iterable<Comparable<?>> data = createHistogramData(); Histogram histogram = new Histogram(data, 4); int binSize = histogram.get(1); assertThat(binSize, is(3)); }