RetryingCacheProxy implements Cache { @Override public void clear() throws CoreException { getProxiedCache().clear(); } RetryingCacheProxy();  RetryingCacheProxy(Cache cache); @Override void init(); @Override void close(); @Override void start(); @Override void stop(); @Override void put(String key, Serializable value); @Override void put(String key, Object value); @Override Object get(String key); @Override void remove(String key); @Override List<String> getKeys(); @Override void clear(); @Override int size(); Cache getProxiedCache(); void setProxiedCache(Cache c); Integer getMaxAttempts(); void setMaxAttempts(Integer max); TimeInterval getRetryInterval(); void setRetryInterval(TimeInterval t); RetryingCacheProxy withMaxAttempts(Integer i); RetryingCacheProxy withRetryInterval(TimeInterval i); RetryingCacheProxy withProxiedCache(Cache c);  }
@Test public void testClear() throws Exception { RetryingCacheProxy cache = new RetryingCacheProxy(new ExpiringMapCache()); initAndStart(cache); try { cache.put("one", "1"); assertEquals(1, cache.size()); cache.clear(); assertEquals(0, cache.size()); } finally { stopAndClose(cache); } }