void (String key, String val) { Map<Object, Object> map = factory.create(); Assume.assumeTrue("Adding (" + key + ", " + val + ") not supported", isSupported(() -> map.put(key, val))); Set<Map.Entry<Object, Object>> entries = map.entrySet(); Assert.assertEquals(1, entries.size()); Assume.assumeTrue("Entry set is readonly", isSupported(() -> entries.clear())); Assert.assertEquals(0, entries.size()); Assert.assertEquals(0, map.size()); map.put(key, val); Assert.assertEquals(1, entries.size()); Iterator<Map.Entry<Object, Object>> it = entries.iterator(); Map.Entry<Object, Object> o = it.next(); Assert.assertEquals(key, o.getKey()); Assert.assertEquals(val, o.getValue()); it.remove(); Assert.assertEquals(0, entries.size()); Assert.assertEquals(0, map.size()); }