MapView implements Map<K, V> { public V remove(Object key) { return this.map.remove(key); } MapView(Map<K, V> map); void clear(); boolean containsKey(Object key); boolean containsValue(Object value); Set<Map.Entry<K, V>> entrySet(); boolean equals(Object obj); V get(Object key); int hashCode(); boolean isEmpty(); Set<K> keySet(); V put(K key, V value); void putAll(Map<? extends K, ? extends V> map); V remove(Object key); int size(); Collection<V> values(); String toString();  }
@Test public void testRemove() { assertNull(this.testobj.remove("k1")); assertNull(this.testobj.remove("k2")); assertNull(this.testobj.remove("k3")); this.source.put("k1", "v1"); assertEquals(1, this.testobj.size()); assertEquals("v1", this.testobj.remove("k1")); assertEquals(0, this.testobj.size()); assertNull(this.testobj.remove("k2")); assertEquals(0, this.testobj.size()); assertNull(this.testobj.remove("k3")); assertEquals(0, this.testobj.size()); this.source.put("k1", "v1"); this.source.put("k2", "v2"); assertEquals(2, this.testobj.size()); assertEquals("v1", this.testobj.remove("k1")); assertEquals(1, this.testobj.size()); assertEquals("v2", this.testobj.remove("k2")); assertEquals(0, this.testobj.size()); assertNull(this.testobj.remove("k3")); assertEquals(0, this.testobj.size()); this.source.put("k1", "v1"); this.source.put("k3", "v3"); assertEquals(2, this.testobj.size()); assertEquals("v1", this.testobj.remove("k1")); assertEquals(1, this.testobj.size()); assertNull(this.testobj.remove("k2")); assertEquals(1, this.testobj.size()); assertEquals("v3", this.testobj.remove("k3")); assertEquals(0, this.testobj.size()); this.source.put("k1", "v1"); this.source.put("k2", "v2"); this.source.put("k3", "v3"); assertEquals(3, this.testobj.size()); assertEquals("v1", this.testobj.remove("k1")); assertEquals(2, this.testobj.size()); assertEquals("v2", this.testobj.remove("k2")); assertEquals(1, this.testobj.size()); assertEquals("v3", this.testobj.remove("k3")); assertEquals(0, this.testobj.size()); }