@Test public void testPromoteOnlyNew() { PersistentObjectCacheWithMRUSort<Bam> cache = builder.withRefresher(new NoopRefresher<Bam>()) .withMruSort().promoteWhenNewOnly().build(); Bam first = new Bam(1, "first"); Bam second = new Bam(2, "second"); CurrentTime.freezeAt(1000); cache.put(first); CurrentTime.freezeAt(2000); cache.put(second); CurrentTime.freezeAt(3000); cache.put(first); Assert.assertEquals(second, cache.valuesByMostRecentlyUsed().iterator().next()); }
public Collection<O> valuesByMostRecentlyUsed() { return mruSorter.values(); }
PersistentObjectCacheWithMRUSort extends PersistentObjectCache<O> { public Collection<O> valuesByMostRecentlyUsed() { return mruSorter.values(); } }
PersistentObjectCacheWithMRUSort extends PersistentObjectCache<O> { public Collection<O> valuesByMostRecentlyUsed() { return mruSorter.values(); } PersistentObjectCacheWithMRUSort(
            String name,
            ShutdownHooks shutdownHooks,
            boolean recordStats,
            boolean startWithRefresh,
            final MruPromotionStrategy<O> mruPromotionStrategy);  PersistentObjectCacheWithMRUSort(
            String name,
            ShutdownHooks shutdownHooks,
            DataRefresher<O> refresher,
            Duration refreshInterval,
            boolean recordStats,
            boolean startWithRefresh,
            final MruPromotionStrategy<O> mruPromotionStrategy); }
PersistentObjectCacheWithMRUSort extends PersistentObjectCache<O> { public Collection<O> valuesByMostRecentlyUsed() { return mruSorter.values(); } PersistentObjectCacheWithMRUSort(
            String name,
            ShutdownHooks shutdownHooks,
            boolean recordStats,
            boolean startWithRefresh,
            final MruPromotionStrategy<O> mruPromotionStrategy);  PersistentObjectCacheWithMRUSort(
            String name,
            ShutdownHooks shutdownHooks,
            DataRefresher<O> refresher,
            Duration refreshInterval,
            boolean recordStats,
            boolean startWithRefresh,
            final MruPromotionStrategy<O> mruPromotionStrategy); @Override Future<Integer> addSort(
            String id, SortKeyFactory<O, T> factory); void touch(O object); Collection<O> valuesByMostRecentlyUsed(); Sorter<O> getMruSorter(); }
PersistentObjectCacheWithMRUSort extends PersistentObjectCache<O> { public Collection<O> valuesByMostRecentlyUsed() { return mruSorter.values(); } PersistentObjectCacheWithMRUSort(
            String name,
            ShutdownHooks shutdownHooks,
            boolean recordStats,
            boolean startWithRefresh,
            final MruPromotionStrategy<O> mruPromotionStrategy);  PersistentObjectCacheWithMRUSort(
            String name,
            ShutdownHooks shutdownHooks,
            DataRefresher<O> refresher,
            Duration refreshInterval,
            boolean recordStats,
            boolean startWithRefresh,
            final MruPromotionStrategy<O> mruPromotionStrategy); @Override Future<Integer> addSort(
            String id, SortKeyFactory<O, T> factory); void touch(O object); Collection<O> valuesByMostRecentlyUsed(); Sorter<O> getMruSorter(); static final String MRU_SORT_ID; }