18
18
19
19
import static org .libj .lang .Assertions .*;
20
20
21
- import java .lang .reflect .ParameterizedType ;
22
21
import java .util .Collection ;
23
22
import java .util .Comparator ;
24
23
import java .util .Iterator ;
@@ -36,7 +35,7 @@ public class SortedList<E,L extends List<E>> extends ObservableList<E,L> {
36
35
@ SuppressWarnings ("rawtypes" )
37
36
private static final Comparator DEFAULT_COMPARATOR = Comparator .nullsFirst (Comparator .naturalOrder ());
38
37
39
- private final Comparator <E > comparator ;
38
+ private final Comparator <? super E > comparator ;
40
39
41
40
/**
42
41
* Creates a new {@link SortedList} with the provided {@link List list} of elements as the underlying target, and the
@@ -60,11 +59,11 @@ public SortedList(final L list) {
60
59
* {@linkplain Comparable natural ordering} should be used.
61
60
* @throws NullPointerException If the provided {@link List list} or {@link Comparator comparator} is null.
62
61
*/
63
- public SortedList (final L list , final Comparator <E > comparator ) {
62
+ public SortedList (final L list , final Comparator <? super E > comparator ) {
64
63
this (list , Objects .requireNonNull (comparator ), true );
65
64
}
66
65
67
- private SortedList (final L list , final Comparator <E > comparator , final boolean sort ) {
66
+ private SortedList (final L list , final Comparator <? super E > comparator , final boolean sort ) {
68
67
super (list );
69
68
this .comparator = comparator ;
70
69
if (sort )
0 commit comments