Util { public static double getBinWidth(Histogram histogram) { return (histogram.getHighValue(0) - histogram.getLowValue(0)) / histogram.getNumBins(0); }  static String getFeatureName(SimpleFeature simpleFeature); static double getBinWidth(Histogram histogram); static int computeBinCount(int accuracy); static final int MAX_ACCURACY; }
@Test public void testGetBinWidth() throws Exception { assertEquals(0.01, Util.getBinWidth(new Histogram(100, 0.0, 1.0, 1)), 1E-4); assertEquals(0.001, Util.getBinWidth(new Histogram(1000, 0.0, 1.0, 1)), 1E-4); assertEquals(0.5, Util.getBinWidth(new Histogram(100, -25.0, 25.0, 1)), 1E-4); assertEquals(0.01, Util.getBinWidth(new Histogram(100, -1.0, 0.0, 1)), 1E-4); }