LRURegion implements CacheRegion<Long, T> { @Override public long lastRegionAccess() { return lastAccess; } LRURegion(String name); @Override long lastRegionAccess(); @Override String name(); @Override long memorySize(); @Override long reduceBy(long reduceSize); @Override T putEntry(Long key, T entry); @Override boolean contains(Long key); @Override T getEntry(Long key); @Override boolean removeEntry(Long key); @Override Collection<T> values(); @Override int size(); @Override void clear(); @Override String toString();  }
@Test public void testLastRegionAccess() { LRURegion<MockCacheEntry<Long>> region = new LRURegion<>("region"); long lastAccess = region.lastRegionAccess(); int testSize = 100000; for(int i=0; i<testSize; i++) { region.putEntry((long)i, new MockCacheEntry<>(9999, (long)i * 2)); } assertTrue(region.lastRegionAccess() > lastAccess); }