DistributedMetaStorageHistoryCache { public DistributedMetaStorageHistoryItem get(long ver) { int size = size(); if (ver < startingVer || ver >= startingVer + size) return null; return items[(from + (int)(ver - startingVer)) & (items.length - 1)]; } DistributedMetaStorageHistoryCache(); DistributedMetaStorageHistoryItem get(long ver); void put(long ver, DistributedMetaStorageHistoryItem item); DistributedMetaStorageHistoryItem removeOldest(); int size(); boolean isEmpty(); void clear(); long sizeInBytes(); DistributedMetaStorageHistoryItem[] toArray(); @Override boolean equals(Object o);  }
@Test public void testEmptyCache() { DistributedMetaStorageHistoryCache histCache = new DistributedMetaStorageHistoryCache(); validate(histCache, emptyList(), 0); assertNull(histCache.get(0)); }