public void testClone() { LRUMap map = new LRUMap(10); map.put("1", "1"); Map cloned = (Map) map.clone(); assertEquals(map.size(), cloned.size()); assertSame(map.get("1"), cloned.get("1")); }
assertEquals(0, map.size()); assertEquals(false, map.isFull()); assertEquals(2, map.maxSize()); assertEquals(1, map.size()); assertEquals(false, map.isFull()); assertEquals(2, map.maxSize()); assertEquals(2, map.size()); assertEquals(true, map.isFull()); assertEquals(2, map.maxSize()); assertEquals(2, map.size()); assertEquals(true, map.isFull()); assertEquals(2, map.maxSize()); assertEquals(2, map.size()); assertEquals(true, map.isFull()); assertEquals(2, map.maxSize()); assertEquals(2, map.size()); assertEquals(true, map.isFull()); assertEquals(2, map.maxSize());
/** * Returns current cache size. */ public int size() { return snapshots.size(); }
/** * Returns current cache size. */ public int size() { return snapshots.size(); }
public int size() { return lru.size(); } } // NewtLRUCache
public int size() { return lru.size(); } } // NewtLRUCache
int inUse = 0; for (LRUMap docNumber : docNumbers) { inUse += docNumber.size();
int inUse = 0; for (LRUMap docNumber : docNumbers) { inUse += docNumber.size();
for (int i = 0; i < docNumbers.length; i++) inUse += docNumbers[i].size();
if (page * size <= historyCache.size()) { Set<QueryInfo> result = Sets.newTreeSet(Collections.reverseOrder());
if (page * size <= historyCache.size()) { Set<QueryInfo> result = Sets.newTreeSet(Collections.reverseOrder());