Set keys = map.keySet();
Collection values = map.values();
assertEquals("values() does not work", "value", values.iterator()
.next());
assertEquals("keySet() does not work", "key", keys.iterator().next());
AbstractMap map2 = (AbstractMap) map.clone();
map2.put("key", "value2");
Collection values2 = map2.values();
assertTrue("values() is identical", values2 != values);
// values() and keySet() on the cloned() map should be different
assertEquals("values() was not cloned", "value2", values2.iterator()