128 |
|
*/ |
129 |
|
public void testComparableFamily() { |
130 |
|
int size = 500; // makes measured test run time -> 60ms |
131 |
< |
ConcurrentHashMap<BI, Boolean> m = |
132 |
< |
new ConcurrentHashMap<BI, Boolean>(); |
131 |
> |
ConcurrentHashMap<BI, Boolean> m = new ConcurrentHashMap<>(); |
132 |
|
for (int i = 0; i < size; i++) { |
133 |
|
assertNull(m.put(new CI(i), true)); |
134 |
|
} |
144 |
|
*/ |
145 |
|
public void testGenericComparable() { |
146 |
|
int size = 120; // makes measured test run time -> 60ms |
147 |
< |
ConcurrentHashMap<Object, Boolean> m = |
149 |
< |
new ConcurrentHashMap<Object, Boolean>(); |
147 |
> |
ConcurrentHashMap<Object, Boolean> m = new ConcurrentHashMap<>(); |
148 |
|
for (int i = 0; i < size; i++) { |
149 |
|
BI bi = new BI(i); |
150 |
|
BS bs = new BS(String.valueOf(i)); |
151 |
< |
LexicographicList<BI> bis = new LexicographicList<BI>(bi); |
152 |
< |
LexicographicList<BS> bss = new LexicographicList<BS>(bs); |
151 |
> |
LexicographicList<BI> bis = new LexicographicList<>(bi); |
152 |
> |
LexicographicList<BS> bss = new LexicographicList<>(bs); |
153 |
|
assertNull(m.putIfAbsent(bis, true)); |
154 |
|
assertTrue(m.containsKey(bis)); |
155 |
|
if (m.putIfAbsent(bss, true) == null) |
168 |
|
*/ |
169 |
|
public void testGenericComparable2() { |
170 |
|
int size = 500; // makes measured test run time -> 60ms |
171 |
< |
ConcurrentHashMap<Object, Boolean> m = |
174 |
< |
new ConcurrentHashMap<Object, Boolean>(); |
171 |
> |
ConcurrentHashMap<Object, Boolean> m = new ConcurrentHashMap<>(); |
172 |
|
for (int i = 0; i < size; i++) { |
173 |
|
m.put(Collections.singletonList(new BI(i)), true); |
174 |
|
} |
175 |
|
|
176 |
|
for (int i = 0; i < size; i++) { |
177 |
< |
LexicographicList<BI> bis = new LexicographicList<BI>(new BI(i)); |
177 |
> |
LexicographicList<BI> bis = new LexicographicList<>(new BI(i)); |
178 |
|
assertTrue(m.containsKey(bis)); |
179 |
|
} |
180 |
|
} |
185 |
|
*/ |
186 |
|
public void testMixedComparable() { |
187 |
|
int size = 1200; // makes measured test run time -> 35ms |
188 |
< |
ConcurrentHashMap<Object, Object> map = |
192 |
< |
new ConcurrentHashMap<Object, Object>(); |
188 |
> |
ConcurrentHashMap<Object, Object> map = new ConcurrentHashMap<>(); |
189 |
|
Random rng = new Random(); |
190 |
|
for (int i = 0; i < size; i++) { |
191 |
|
Object x; |