import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;

import junit.framework.TestCase;

public class ConcurrentModificationBug  extends TestCase {

	public void removeFoo(Map<String, Object> map) {

		// FIXME: We should generate a warning here
		for (String s : map.keySet())
			if (s.startsWith("foo"))
				map.remove(s);

	}
	
	public void testRemoveFoo() {
		HashMap<String,Object> s = new HashMap<String,Object>();
		s.put("foo1", "foo1");
		s.put("foo2", "foo1");
		s.put("bar", "foo1");
		removeFoo(s);
		
	}

}

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


git-svn-id: e7d6bde23f017c9ff4efd468d79d66def666766b@5545 eae3c2d3-9b19-0410-a86e-396b6ccb6ab3
