Here is my test for ConcurrentHashMap
@Test
public void testIt2() {
Map<String, String> map = new ConcurrentHashMap<String, String>();
map.put("2", "2");
map.put("1", "1");
for (Entry<String, String> entry : map.entrySet()) {
map.clear();
System.out.println(entry.getKey());
}
}
the output is :
1
2
why?