@Test public void testRemove() { Map<String, String> delegate = new HashMap<>(); delegate.put("key", "value"); Map<String, String> ignoreEmptyKeyMap = new IgnoreEmptyKeyMapDecorator<>(delegate); ignoreEmptyKeyMap.remove("key"); assertEquals("Size should now be 0", 0, ignoreEmptyKeyMap.size()); }
@Override public V remove(Object key) { return delegate.remove(key); }
IgnoreEmptyKeyMapDecorator implements Map<String, V> { @Override public V remove(Object key) { return delegate.remove(key); } }
IgnoreEmptyKeyMapDecorator implements Map<String, V> { @Override public V remove(Object key) { return delegate.remove(key); } IgnoreEmptyKeyMapDecorator(Map<String, V> delegate); }
IgnoreEmptyKeyMapDecorator implements Map<String, V> { @Override public V remove(Object key) { return delegate.remove(key); } IgnoreEmptyKeyMapDecorator(Map<String, V> delegate); @Override int size(); @Override boolean isEmpty(); @Override boolean containsKey(Object key); @Override boolean containsValue(Object value); @Override V get(Object key); @Override V put(String key, V value); @Override V remove(Object key); @Override void putAll(Map<? extends String, ? extends V> m); @Override void clear(); @NotNull @Override Set<String> keySet(); @NotNull @Override Collection<V> values(); @NotNull @Override Set<Entry<String, V>> entrySet(); }
IgnoreEmptyKeyMapDecorator implements Map<String, V> { @Override public V remove(Object key) { return delegate.remove(key); } IgnoreEmptyKeyMapDecorator(Map<String, V> delegate); @Override int size(); @Override boolean isEmpty(); @Override boolean containsKey(Object key); @Override boolean containsValue(Object value); @Override V get(Object key); @Override V put(String key, V value); @Override V remove(Object key); @Override void putAll(Map<? extends String, ? extends V> m); @Override void clear(); @NotNull @Override Set<String> keySet(); @NotNull @Override Collection<V> values(); @NotNull @Override Set<Entry<String, V>> entrySet();  }