fix some tests that were failing on Java 8

since they were sensitive to the sort algorithm used (since they
abused the requirements for a sorting predicate)