@Test public void getClone() { final PersistentObjectCache<String, String> cache = new PersistentObjectCache<>(4); cache.put("IDEA", "good IDEA"); cache.put("NetBeans", "bad IDEA"); final PersistentObjectCache<String, String> copy = cache.getClone(null); Assert.assertNotNull(copy.get("IDEA")); copy.put("Eclipse", "An IDE"); Assert.assertNull(cache.get("Eclipse")); Assert.assertNotNull(cache.get("NetBeans")); Assert.assertNotNull(copy.get("IDEA")); Assert.assertNotNull(copy.remove("NetBeans")); Assert.assertNull(copy.get("NetBeans")); Assert.assertNotNull(cache.get("NetBeans")); }
public PersistentObjectCache<K, V> getClone(@Nullable final EvictListener<K, V> listener) { return new PersistentObjectCache<>(this, listener); }
PersistentObjectCache extends CacheHitRateable { public PersistentObjectCache<K, V> getClone(@Nullable final EvictListener<K, V> listener) { return new PersistentObjectCache<>(this, listener); } }
PersistentObjectCache extends CacheHitRateable { public PersistentObjectCache<K, V> getClone(@Nullable final EvictListener<K, V> listener) { return new PersistentObjectCache<>(this, listener); } PersistentObjectCache();  PersistentObjectCache(int size);  PersistentObjectCache(final int size, float secondGenSizeRatio); protected  PersistentObjectCache(@NotNull final PersistentObjectCache<K, V> source, @Nullable final EvictListener<K, V> listener); }
PersistentObjectCache extends CacheHitRateable { public PersistentObjectCache<K, V> getClone(@Nullable final EvictListener<K, V> listener) { return new PersistentObjectCache<>(this, listener); } PersistentObjectCache();  PersistentObjectCache(int size);  PersistentObjectCache(final int size, float secondGenSizeRatio); protected  PersistentObjectCache(@NotNull final PersistentObjectCache<K, V> source, @Nullable final EvictListener<K, V> listener); void clear(); int size(); int count(); V get(@NotNull final K key); void put(@NotNull final K key, @NotNull final V x); V tryKey(@NotNull final K key); V getObject(@NotNull final K key); void cacheObject(@NotNull final K key, @NotNull final V x); V remove(@NotNull final K key); void forEachKey(final ObjectProcedure<K> procedure); void forEachEntry(final PairProcedure<K, V> procedure); Iterator<K> keys(); Iterator<V> values(); PersistentObjectCache<K, V> getClone(@Nullable final EvictListener<K, V> listener); }
PersistentObjectCache extends CacheHitRateable { public PersistentObjectCache<K, V> getClone(@Nullable final EvictListener<K, V> listener) { return new PersistentObjectCache<>(this, listener); } PersistentObjectCache();  PersistentObjectCache(int size);  PersistentObjectCache(final int size, float secondGenSizeRatio); protected  PersistentObjectCache(@NotNull final PersistentObjectCache<K, V> source, @Nullable final EvictListener<K, V> listener); void clear(); int size(); int count(); V get(@NotNull final K key); void put(@NotNull final K key, @NotNull final V x); V tryKey(@NotNull final K key); V getObject(@NotNull final K key); void cacheObject(@NotNull final K key, @NotNull final V x); V remove(@NotNull final K key); void forEachKey(final ObjectProcedure<K> procedure); void forEachEntry(final PairProcedure<K, V> procedure); Iterator<K> keys(); Iterator<V> values(); PersistentObjectCache<K, V> getClone(@Nullable final EvictListener<K, V> listener);  }