@Test public void testLRUCache() { LRUCache<String, String> cache = new LRUCache<>(1); cache.put("k1", "v1"); Assert.assertTrue(cache.containsKey("k1")); cache.put("k2", "v2"); Assert.assertFalse(cache.containsKey("k1")); Assert.assertTrue(cache.containsKey("k2")); }
public LRUCache(final int capacity) { super(capacity, LOAD_FACTOR, ACCESS_ORDER); this.capacity = capacity; }
LRUCache extends LinkedHashMap<K, V> { public LRUCache(final int capacity) { super(capacity, LOAD_FACTOR, ACCESS_ORDER); this.capacity = capacity; } }
LRUCache extends LinkedHashMap<K, V> { public LRUCache(final int capacity) { super(capacity, LOAD_FACTOR, ACCESS_ORDER); this.capacity = capacity; } LRUCache(final int capacity); }
LRUCache extends LinkedHashMap<K, V> { public LRUCache(final int capacity) { super(capacity, LOAD_FACTOR, ACCESS_ORDER); this.capacity = capacity; } LRUCache(final int capacity);  }
LRUCache extends LinkedHashMap<K, V> { public LRUCache(final int capacity) { super(capacity, LOAD_FACTOR, ACCESS_ORDER); this.capacity = capacity; } LRUCache(final int capacity);   }