Cache { public void clear() { _log.debug("Cleaning the cache"); _accessLock.lock(); try { _storage.clear(); } finally { _accessLock.unlock(); } } Cache(String name, int size, long entryLifeTime, long entryIdleTime);  Cache(final String name, int size, long entryLifeTime, long entryIdleTime,
            CacheEventListener<K, V> eventListener);  Cache(final String name, int size, long entryLifeTime, long entryIdleTime,
            CacheEventListener<K, V> eventListener, Clock clock); String getName(); void put(K k, V v); void put(K k, V v, long entryMaxLifeTime, long entryIdleTime); V get(K k); V remove(K k); long getEntryIdleTime(); long getEntryLiveTime(); void clear(); void cleanUp(); List<CacheElement<V>> entries(); long lastClean();  }
@Test public void testClear() { _cache.put("key1", "value1"); _cache.put("key2", "value2"); _cache.clear(); assertTrue("Not all entries are removed", _cache.entries().isEmpty()); }