@Test public void testRemove() { final LRUCache<String,String> cut = new LRUCache<String, String>( 3 ); cut.put("foo", "bar"); assertTrue( cut.containsKey( "foo" ) ); assertEquals( cut.remove( "foo" ), "bar" ); assertFalse( cut.containsKey( "foo" ) ); }
public V remove( final K key ) { synchronized ( _map ) { final ManagedItem<V> removed = _map.remove( key ); return removed != null ? removed._value : null; } }
LRUCache { public V remove( final K key ) { synchronized ( _map ) { final ManagedItem<V> removed = _map.remove( key ); return removed != null ? removed._value : null; } } }
LRUCache { public V remove( final K key ) { synchronized ( _map ) { final ManagedItem<V> removed = _map.remove( key ); return removed != null ? removed._value : null; } } LRUCache( final int size );  LRUCache( final int size, final long ttlInMillis ); }
LRUCache { public V remove( final K key ) { synchronized ( _map ) { final ManagedItem<V> removed = _map.remove( key ); return removed != null ? removed._value : null; } } LRUCache( final int size );  LRUCache( final int size, final long ttlInMillis ); void clear(); V put( final K key, final V value ); V putIfDifferent( final K key, final V value ); V remove( final K key ); V get( final K key ); boolean containsKey( final K key ); List<K> getKeys(); List<K> getKeysSortedByValue( final Comparator<V> comparator ); }
LRUCache { public V remove( final K key ) { synchronized ( _map ) { final ManagedItem<V> removed = _map.remove( key ); return removed != null ? removed._value : null; } } LRUCache( final int size );  LRUCache( final int size, final long ttlInMillis ); void clear(); V put( final K key, final V value ); V putIfDifferent( final K key, final V value ); V remove( final K key ); V get( final K key ); boolean containsKey( final K key ); List<K> getKeys(); List<K> getKeysSortedByValue( final Comparator<V> comparator );  }