### Question:
TimedLRUCache implements Cache<K, V> { @Override public void clear() { entryTimes.clear(); keys.clear(); entries.clear(); } TimedLRUCache(final int capacity, final long storeTime); @Override V get(K key); @Override synchronized void put(K key, V value); @Override void clear();  }### Answer:
@Test public void clear() { final int capacity = 2; final long storeTime = 1000; final String[] keys = new String[]{ "test1", "test2" }; final Integer[] values = new Integer[]{ 1, 2 }; Cache<String, Integer> cache = new TimedLRUCache<>(capacity, storeTime); for (int i = 0; i < keys.length; i ++) { cache.put(keys[i], values[i]); } assertEquals(values[0], cache.get(keys[0])); assertEquals(values[1], cache.get(keys[1])); cache.clear(); for (String k : keys) { assertNull(cache.get(k)); } }