28 |
|
public boolean isConcurrent() { return false; } |
29 |
|
public boolean permitsNulls() { return false; } |
30 |
|
} |
31 |
+ |
class ComparatorImplementation implements CollectionImplementation { |
32 |
+ |
public Class<?> klazz() { return PriorityQueue.class; } |
33 |
+ |
public Collection emptyCollection() { return new PriorityQueue(new MyReverseComparator()); } |
34 |
+ |
public Object makeElement(int i) { return i; } |
35 |
+ |
public boolean isConcurrent() { return false; } |
36 |
+ |
public boolean permitsNulls() { return false; } |
37 |
+ |
} |
38 |
|
return newTestSuite(PriorityQueueTest.class, |
39 |
< |
CollectionTest.testSuite(new Implementation())); |
39 |
> |
CollectionTest.testSuite(new Implementation()), |
40 |
> |
CollectionTest.testSuite(new ComparatorImplementation())); |
41 |
|
} |
42 |
|
|
43 |
< |
static class MyReverseComparator implements Comparator { |
43 |
> |
static class MyReverseComparator implements Comparator, java.io.Serializable { |
44 |
|
public int compare(Object x, Object y) { |
45 |
|
return ((Comparable)y).compareTo(x); |
46 |
|
} |