protected static void testTopByValue(int expectedSize,
List<IDValue> values,
boolean reverse) {
Assert.assertEquals(expectedSize, values.size());
for (int i = 0; i < values.size(); i++) {
IDValue value = values.get(i);
double thisScore = value.getValue();
Assert.assertFalse(Double.isNaN(thisScore));
Assert.assertFalse(Double.isInfinite(thisScore));
if (i > 0) {
double lastScore = values.get(i-1).getValue();
if (reverse) {