30 |
|
|
31 |
|
/** |
32 |
|
* Returns a new set of given size containing consecutive |
33 |
< |
* Integers 0 ... n. |
33 |
> |
* Integers 0 ... n - 1. |
34 |
|
*/ |
35 |
< |
private NavigableSet<Integer> populatedSet(int n) { |
36 |
< |
ConcurrentSkipListSet<Integer> q = |
37 |
< |
new ConcurrentSkipListSet<Integer>(); |
35 |
> |
private static NavigableSet<Integer> populatedSet(int n) { |
36 |
> |
ConcurrentSkipListSet<Integer> q = new ConcurrentSkipListSet<>(); |
37 |
|
assertTrue(q.isEmpty()); |
38 |
|
|
39 |
|
for (int i = n - 1; i >= 0; i -= 2) |
51 |
|
/** |
52 |
|
* Returns a new set of first 5 ints. |
53 |
|
*/ |
54 |
< |
private NavigableSet set5() { |
54 |
> |
private static NavigableSet set5() { |
55 |
|
ConcurrentSkipListSet q = new ConcurrentSkipListSet(); |
56 |
|
assertTrue(q.isEmpty()); |
57 |
|
q.add(one); |
69 |
|
/** |
70 |
|
* Returns a new set of first 5 negative ints. |
71 |
|
*/ |
72 |
< |
private NavigableSet dset5() { |
72 |
> |
private static NavigableSet dset5() { |
73 |
|
ConcurrentSkipListSet q = new ConcurrentSkipListSet(); |
74 |
|
assertTrue(q.isEmpty()); |
75 |
|
q.add(m1); |
475 |
|
} |
476 |
|
|
477 |
|
/** |
478 |
< |
* A deserialized serialized set has same elements |
478 |
> |
* A deserialized/reserialized set equals original |
479 |
|
*/ |
480 |
|
public void testSerialization() throws Exception { |
481 |
|
NavigableSet x = populatedSet(SIZE); |
974 |
|
} |
975 |
|
|
976 |
|
/** |
977 |
< |
* A deserialized serialized set has same elements |
977 |
> |
* A deserialized/reserialized set equals original |
978 |
|
*/ |
979 |
|
public void testDescendingSerialization() throws Exception { |
980 |
|
NavigableSet x = dset5(); |