333 |
|
} |
334 |
|
|
335 |
|
/** |
336 |
+ |
* Test keySet().removeAll on empty map |
337 |
+ |
*/ |
338 |
+ |
public void testKeySet_empty_removeAll() { |
339 |
+ |
ConcurrentHashMap<Integer, String> map = new ConcurrentHashMap<>(); |
340 |
+ |
Set<Integer> set = map.keySet(); |
341 |
+ |
set.removeAll(Collections.emptyList()); |
342 |
+ |
assertTrue(map.isEmpty()); |
343 |
+ |
assertTrue(set.isEmpty()); |
344 |
+ |
// following is test for JDK-8163353 |
345 |
+ |
set.removeAll(Collections.emptySet()); |
346 |
+ |
assertTrue(map.isEmpty()); |
347 |
+ |
assertTrue(set.isEmpty()); |
348 |
+ |
} |
349 |
+ |
|
350 |
+ |
/** |
351 |
|
* keySet.toArray returns contains all keys |
352 |
|
*/ |
353 |
|
public void testKeySetToArray() { |