-
public class ComparatorContractCreated by gpeterso on 3/28/17.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumComparatorContract.CompToZero
-
Method Summary
Modifier and Type Method Description static <T> voidtestComparator(T least1, T middle1, T greatest1, Comparator<T> comparator)Tests the various properties the Comparable contract is supposed to uphold. -
-
Method Detail
-
testComparator
static <T> void testComparator(T least1, T middle1, T greatest1, Comparator<T> comparator)
Tests the various properties the Comparable contract is supposed to uphold. Also tests that the behavior of compareTo() is compatible with equals() and hashCode() which is strongly suggested, but not actually required. Write your own test if you don't want that. Expects three unique objects. The first must be less than the second, which in turn is less than the third. See note in class documentation.
-
-
-
-