9
9
10
10
import static java .lang .Integer .signum ;
11
11
12
- public class OrderingComparison <T extends Comparable <T >> extends TypeSafeMatcher <T > {
12
+ public class OrderingComparison <T extends Comparable <? super T >> extends TypeSafeMatcher <T > {
13
13
private static final int LESS_THAN = -1 ;
14
14
private static final int GREATER_THAN = 1 ;
15
15
private static final int EQUAL = 0 ;
@@ -67,7 +67,7 @@ private static String asText(int comparison) {
67
67
*
68
68
*/
69
69
@ 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 ) {
71
71
return new OrderingComparison <T >(value , EQUAL , EQUAL );
72
72
}
73
73
@@ -85,7 +85,7 @@ public static <T extends Comparable<T>> Matcher<T> comparesEqualTo(T value) {
85
85
*
86
86
*/
87
87
@ 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 ) {
89
89
return new OrderingComparison <T >(value , GREATER_THAN , GREATER_THAN );
90
90
}
91
91
@@ -103,7 +103,7 @@ public static <T extends Comparable<T>> Matcher<T> greaterThan(T value) {
103
103
*
104
104
*/
105
105
@ 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 ) {
107
107
return new OrderingComparison <T >(value , EQUAL , GREATER_THAN );
108
108
}
109
109
@@ -121,7 +121,7 @@ public static <T extends Comparable<T>> Matcher<T> greaterThanOrEqualTo(T value)
121
121
*
122
122
*/
123
123
@ 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 ) {
125
125
return new OrderingComparison <T >(value , LESS_THAN , LESS_THAN );
126
126
}
127
127
@@ -139,7 +139,7 @@ public static <T extends Comparable<T>> Matcher<T> lessThan(T value) {
139
139
*
140
140
*/
141
141
@ 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 ) {
143
143
return new OrderingComparison <T >(value , LESS_THAN , EQUAL );
144
144
}
145
145
}
0 commit comments