@Test public void testCache() throws InterruptedException { CaffeineCacheFactory ccf = new CaffeineCacheFactory(); Cache<String, String> cache = ccf.get("default"); assertNull(cache.put("key", "value", null)); assertNotNull(cache.put("key", "value", 10l)); Thread.sleep(20); assertNull(cache.get("key")); }
@Override public <K, V> Cache<K, V> get(String name) { map.put(name, new CaffeineCache<K,V>(name, 512)); return map.get(name); }
CaffeineCacheFactory implements CacheFactory { @Override public <K, V> Cache<K, V> get(String name) { map.put(name, new CaffeineCache<K,V>(name, 512)); return map.get(name); } }
CaffeineCacheFactory implements CacheFactory { @Override public <K, V> Cache<K, V> get(String name) { map.put(name, new CaffeineCache<K,V>(name, 512)); return map.get(name); }  }
CaffeineCacheFactory implements CacheFactory { @Override public <K, V> Cache<K, V> get(String name) { map.put(name, new CaffeineCache<K,V>(name, 512)); return map.get(name); }  @Override Cache<K, V> get(String name); @Override void destroy(); }
CaffeineCacheFactory implements CacheFactory { @Override public <K, V> Cache<K, V> get(String name) { map.put(name, new CaffeineCache<K,V>(name, 512)); return map.get(name); }  @Override Cache<K, V> get(String name); @Override void destroy();  }