FastSafeIterableMap extends SafeIterableMap<K, V> { @Override public V remove(@NonNull K key) { V removed = super.remove(key); mHashMap.remove(key); return removed; }  @Override V putIfAbsent(@NonNull K key, @NonNull V v); @Override V remove(@NonNull K key); boolean contains(K key); Map.Entry<K, V> ceil(K k);  }
@Test public void testRemove() { FastSafeIterableMap<Integer, Integer> map = new FastSafeIterableMap<>(); map.putIfAbsent(10, 20); map.putIfAbsent(20, 40); assertThat(map.contains(10), is(true)); assertThat(map.contains(20), is(true)); assertThat(map.remove(10), is(20)); assertThat(map.contains(10), is(false)); assertThat(map.putIfAbsent(10, 30), nullValue()); assertThat(map.putIfAbsent(10, 40), is(30)); }