int lowerWaterMark = cacheSize;
int upperWaterMark = (int)(lowerWaterMark * 1.1);
Random r = new Random(0);
ConcurrentLRUCache cache = new ConcurrentLRUCache(upperWaterMark, lowerWaterMark, (upperWaterMark+lowerWaterMark)/2, upperWaterMark, false, false, null);
boolean getSize=false;
int minSize=0,maxSize=0;
for (int i=0; i<iter; i++) {
cache.put(r.nextInt(maxKey),"TheValue");
int sz = cache.size();
if (!getSize && sz >= cacheSize) {
getSize = true;
minSize = sz;
} else {
if (sz < minSize) minSize=sz;
else if (sz > maxSize) maxSize=sz;
}
}
cache.destroy();
long end = System.currentTimeMillis();
System.out.println("time=" + (end-start) + ", minSize="+minSize+",maxSize="+maxSize);
}