-
public class CompareToContractTests the various properties the Comparable contract is supposed to uphold. If you think this isconfusing, realize that like equals(), it is often not possible to implement a one-sidedcompareTo() correctly with inheritance - it's a broken concept, but it's still used so often thatyou have to do your best with it.I got the idea of contract-based testing from watching Bill Venners:https://www.youtube.com/watch?v=bCTZQi2dpl8