assertEquals(scheme.fromBin(i + 1), hist.value(i / 10.0 + EPS), EPS);
}
@Test
public void testConstantBinScheme() {
ConstantBinScheme scheme = new ConstantBinScheme(5, -5, 5);
assertEquals("A value below the lower bound should map to the first bin", 0, scheme.toBin(-5.01));
assertEquals("A value above the upper bound should map to the last bin", 4, scheme.toBin(5.01));
assertEquals("Check boundary of bucket 1", 1, scheme.toBin(-5));
assertEquals("Check boundary of bucket 4", 4, scheme.toBin(5));
assertEquals("Check boundary of bucket 3", 3, scheme.toBin(4.9999));
checkBinningConsistency(new ConstantBinScheme(4, 0, 5));
checkBinningConsistency(scheme);
}