JodaTime has
public final class DateTime extends BaseDateTime {...}
which works its way up to
public interface ReadableInstant extends Comparable<ReadableInstant>
Hamcrest has
public static <T extends java.lang.Comparable<T>> org.hamcrest.Matcher<? super T>
greaterThan(T value) {...}
If I try
greaterThan(new DateTime());
then I get a compile error (Eclipse gives most clue)
The generic method greaterThan(T) of type Matchers is not applicable for the arguments (DateTime). The inferred type DateTime is not a valid substitute for the bounded parameter >
Am I right in thinking that the signature of greaterThan
should actually be
public static <T extends java.lang.Comparable<? super T>> org.hamcrest.Matcher<? super T>
greaterThan(T value)
? And is there a way to fit these together short of casting to the raw Comparable
?