99
1010import static java .lang .Integer .signum ;
1111
12- public class OrderingComparison <T extends Comparable <T >> extends TypeSafeMatcher <T > {
12+ public class OrderingComparison <T extends Comparable <? super T >> extends TypeSafeMatcher <T > {
1313 private static final int LESS_THAN = -1 ;
1414 private static final int GREATER_THAN = 1 ;
1515 private static final int EQUAL = 0 ;
@@ -67,7 +67,7 @@ private static String asText(int comparison) {
6767 *
6868 */
6969 @ Factory
70- public static <T extends Comparable <T >> Matcher <T > comparesEqualTo (T value ) {
70+ public static <T extends Comparable <? super T >> Matcher <T > comparesEqualTo (T value ) {
7171 return new OrderingComparison <T >(value , EQUAL , EQUAL );
7272 }
7373
@@ -85,7 +85,7 @@ public static <T extends Comparable<T>> Matcher<T> comparesEqualTo(T value) {
8585 *
8686 */
8787 @ Factory
88- public static <T extends Comparable <T >> Matcher <T > greaterThan (T value ) {
88+ public static <T extends Comparable <? super T >> Matcher <T > greaterThan (T value ) {
8989 return new OrderingComparison <T >(value , GREATER_THAN , GREATER_THAN );
9090 }
9191
@@ -103,7 +103,7 @@ public static <T extends Comparable<T>> Matcher<T> greaterThan(T value) {
103103 *
104104 */
105105 @ Factory
106- public static <T extends Comparable <T >> Matcher <T > greaterThanOrEqualTo (T value ) {
106+ public static <T extends Comparable <? super T >> Matcher <T > greaterThanOrEqualTo (T value ) {
107107 return new OrderingComparison <T >(value , EQUAL , GREATER_THAN );
108108 }
109109
@@ -121,7 +121,7 @@ public static <T extends Comparable<T>> Matcher<T> greaterThanOrEqualTo(T value)
121121 *
122122 */
123123 @ Factory
124- public static <T extends Comparable <T >> Matcher <T > lessThan (T value ) {
124+ public static <T extends Comparable <? super T >> Matcher <T > lessThan (T value ) {
125125 return new OrderingComparison <T >(value , LESS_THAN , LESS_THAN );
126126 }
127127
@@ -139,7 +139,7 @@ public static <T extends Comparable<T>> Matcher<T> lessThan(T value) {
139139 *
140140 */
141141 @ Factory
142- public static <T extends Comparable <T >> Matcher <T > lessThanOrEqualTo (T value ) {
142+ public static <T extends Comparable <? super T >> Matcher <T > lessThanOrEqualTo (T value ) {
143143 return new OrderingComparison <T >(value , LESS_THAN , EQUAL );
144144 }
145145}
0 commit comments