@Test public void remove() { int expectedOld = expected.remove(4); int mapOld = map.remove(4); assertEquals(expectedOld, mapOld); assertEquals(expected, map); }
@Override public V remove(Object k) { V v = internalMap.remove(k); if (v == SENTINEL) v = compute.apply((K)k); return v; }
LazyMap implements Map<K, V> { @Override public V remove(Object k) { V v = internalMap.remove(k); if (v == SENTINEL) v = compute.apply((K)k); return v; } }
LazyMap implements Map<K, V> { @Override public V remove(Object k) { V v = internalMap.remove(k); if (v == SENTINEL) v = compute.apply((K)k); return v; } LazyMap(Function<? super K, ? extends V> compute);  LazyMap(Function<? super K, ? extends V> compute, Supplier<Map<K, V>> mapSupplier);  LazyMap(Function<? super K, ? extends V> compute, Collection<? extends K> initialKeys);  LazyMap(Function<? super K, ? extends V> compute, Collection<? extends K> initialKeys, Supplier<Map<K, V>> mapSupplier); }
LazyMap implements Map<K, V> { @Override public V remove(Object k) { V v = internalMap.remove(k); if (v == SENTINEL) v = compute.apply((K)k); return v; } LazyMap(Function<? super K, ? extends V> compute);  LazyMap(Function<? super K, ? extends V> compute, Supplier<Map<K, V>> mapSupplier);  LazyMap(Function<? super K, ? extends V> compute, Collection<? extends K> initialKeys);  LazyMap(Function<? super K, ? extends V> compute, Collection<? extends K> initialKeys, Supplier<Map<K, V>> mapSupplier); @Override boolean isEmpty(); @Override int size(); @Override V get(Object key); @Override V put(K key, V value); @Override void putAll(Map<? extends K, ? extends V> m); @Override V remove(Object k); @Override Set<K> keySet(); @Override Collection<V> values(); @Override Set<Map.Entry<K, V>> entrySet(); @Override boolean containsKey(Object key); @Override boolean containsValue(Object value); @Override void clear(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString(); }
LazyMap implements Map<K, V> { @Override public V remove(Object k) { V v = internalMap.remove(k); if (v == SENTINEL) v = compute.apply((K)k); return v; } LazyMap(Function<? super K, ? extends V> compute);  LazyMap(Function<? super K, ? extends V> compute, Supplier<Map<K, V>> mapSupplier);  LazyMap(Function<? super K, ? extends V> compute, Collection<? extends K> initialKeys);  LazyMap(Function<? super K, ? extends V> compute, Collection<? extends K> initialKeys, Supplier<Map<K, V>> mapSupplier); @Override boolean isEmpty(); @Override int size(); @Override V get(Object key); @Override V put(K key, V value); @Override void putAll(Map<? extends K, ? extends V> m); @Override V remove(Object k); @Override Set<K> keySet(); @Override Collection<V> values(); @Override Set<Map.Entry<K, V>> entrySet(); @Override boolean containsKey(Object key); @Override boolean containsValue(Object value); @Override void clear(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString();  }