341 |
|
Set x = populatedSet(SIZE); |
342 |
|
Set y = serialClone(x); |
343 |
|
|
344 |
< |
assertTrue(x != y); |
344 |
> |
assertNotSame(y, x); |
345 |
|
assertEquals(x.size(), y.size()); |
346 |
|
assertEquals(x.toString(), y.toString()); |
347 |
|
assertTrue(Arrays.equals(x.toArray(), y.toArray())); |
348 |
|
assertEquals(x, y); |
349 |
|
assertEquals(y, x); |
350 |
|
} |
351 |
+ |
|
352 |
+ |
/** |
353 |
+ |
* addAll is idempotent |
354 |
+ |
*/ |
355 |
+ |
public void testAddAll_idempotent() throws Exception { |
356 |
+ |
Set x = populatedSet(SIZE); |
357 |
+ |
Set y = new CopyOnWriteArraySet(x); |
358 |
+ |
y.addAll(x); |
359 |
+ |
assertEquals(x, y); |
360 |
+ |
assertEquals(y, x); |
361 |
+ |
} |
362 |
|
|
363 |
|
} |