new Object[][] { { Percentile.EstimationType.LEGACY, 20.82 }, { Percentile.EstimationType.R_1, 19.8 },
{ Percentile.EstimationType.R_2, 19.8 }, { Percentile.EstimationType.R_3, 19.8 }, { Percentile.EstimationType.R_4, 19.310 },
{ Percentile.EstimationType.R_5, 20.280}, { Percentile.EstimationType.R_6, 20.820},
{ Percentile.EstimationType.R_7, 19.555 }, { Percentile.EstimationType.R_8, 20.460 },{Percentile.EstimationType.R_9,20.415} };
try {
Percentile.EstimationType.LEGACY.evaluate(testArray, -1d, new KthSelector(new MedianOf3PivotingStrategy()));
} catch (final OutOfRangeException oore) {
}
try {
Percentile.EstimationType.LEGACY.evaluate(testArray, 101d, new KthSelector());
} catch (final OutOfRangeException oore) {
}
try {
Percentile.EstimationType.LEGACY.evaluate(testArray, 50d, new KthSelector());
} catch(final OutOfRangeException oore) {
}
for (final Object[] o : map) {
final Percentile.EstimationType e = (Percentile.EstimationType) o[0];
final double expected = (Double) o[1];
final double result = e.evaluate(testArray, DEFAULT_PERCENTILE, new KthSelector());
Assert.assertEquals("expected[" + e + "] = " + expected +
" but was = " + result, expected, result, tolerance);
}
}