testcase asserting compareTo contract