try {
map.put("one", "1");
assertEquals("size should be one", 1, map.size());
map.clear();
assertEquals("size should be zero", 0, map.size());
assertTrue("Should not have entries", !map.entrySet().iterator()
.hasNext());
assertTrue("Should not have keys", !map.keySet().iterator()
.hasNext());
assertTrue("Should not have values", !map.values().iterator()
.hasNext());
} catch (UnsupportedOperationException e) {
}
try {
map.put("one", "1");
assertEquals("size should be one", 1, map.size());
map.remove("one");
assertEquals("size should be zero", 0, map.size());
assertTrue("Should not have entries", !map.entrySet().iterator()
.hasNext());
assertTrue("Should not have keys", !map.keySet().iterator()
.hasNext());
assertTrue("Should not have values", !map.values().iterator()
.hasNext());
} catch (UnsupportedOperationException e) {
}