hamcrest / JavaHamcrest

Java (and original) version of Hamcrest

Home Page:http://hamcrest.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

comparator method don't accept all possible comparable objects

bjrke opened this issue · comments

https://avro.apache.org/ for example creates classes which implement Comparable<SpecificRecord> but not Comparable<ClassName>.
Instead every avro class extends SpecificRecordBase which also contains the implementation of compareTo.
Because of this its not easy to use matchers like lessThan.

A solution is to replace Comparable<T> with Comparable<? super T> like I did in my PR #327