--- jsr166/src/test/tck/ConcurrentHashMapTest.java 2016/07/17 19:02:07 1.49 +++ jsr166/src/test/tck/ConcurrentHashMapTest.java 2016/08/22 18:38:28 1.50 @@ -333,6 +333,21 @@ public class ConcurrentHashMapTest exten } /** + * Test keySet().removeAll on empty map + */ + public void testKeySet_empty_removeAll() { + ConcurrentHashMap map = new ConcurrentHashMap<>(); + Set set = map.keySet(); + set.removeAll(Collections.emptyList()); + assertTrue(map.isEmpty()); + assertTrue(set.isEmpty()); + // following is test for JDK-8163353 + set.removeAll(Collections.emptySet()); + assertTrue(map.isEmpty()); + assertTrue(set.isEmpty()); + } + + /** * keySet.toArray returns contains all keys */ public void testKeySetToArray() {