public void add(CachedBlock block) {
totalSize += block.heapSize();
queue.add(block);
}
public long free(long toFree) {
<BUG>CachedBlock [] blocks = queue.get();
</BUG>
long freedBytes = 0;
<BUG>for(int i=0; i<blocks.length; i++) {
freedBytes += evictBlock(blocks[i]);
</BUG>
if(freedBytes >= toFree) {

public void add(CachedBlock block) {
totalSize += block.heapSize();
queue.add(block);
}
public long free(long toFree) {
LinkedList<CachedBlock> blocks = queue.get();
long freedBytes = 0;
for(CachedBlock cb: blocks) {
freedBytes += evictBlock(cb);
if(freedBytes >= toFree) {
