@@ -0,0 +1,540 @@
+import java.util.HashMap;%0Aimport java.util.HashSet;%0Aimport java.util.Map;%0A%0Aimport junit.framework.TestCase;%0A%0Apublic class ConcurrentModificationBug  extends TestCase %7B%0A%0A%09public void removeFoo(Map%3CString, Object%3E map) %7B%0A%0A%09%09// FIXME: We should generate a warning here%0A%09%09for (String s : map.keySet())%0A%09%09%09if (s.startsWith(%22foo%22))%0A%09%09%09%09map.remove(s);%0A%0A%09%7D%0A%09%0A%09public void testRemoveFoo() %7B%0A%09%09HashMap%3CString,Object%3E s = new HashMap%3CString,Object%3E();%0A%09%09s.put(%22foo1%22, %22foo1%22);%0A%09%09s.put(%22foo2%22, %22foo1%22);%0A%09%09s.put(%22bar%22, %22foo1%22);%0A%09%09removeFoo(s);%0A%09%09%0A%09%7D%0A%0A%7D%0A

Add test case for using remove on map while iterating through it