createBlockFile(mStorageDirs[1], BlockInfo.computeBlockId(5, 0), 600);
Thread.sleep(10);
createBlockFile(mStorageDirs[2], BlockInfo.computeBlockId(6, 0), 500);
Set<Integer> pinList = new HashSet<Integer>();
EvictStrategy eviction = new EvictLRU(true);
pinList.add(1);
Pair<StorageDir, List<tachyon.worker.hierarchy.BlockInfo>> lruResult =
eviction.getDirCandidate(mStorageDirs, pinList, 300);
Assert.assertEquals(mStorageDirs[1], lruResult.getFirst());
Assert.assertEquals(1, lruResult.getSecond().size());
Assert.assertEquals(lruResult.getSecond().get(0).getBlockId(), BlockInfo.computeBlockId(2, 0));
pinList.add(2);
lruResult = eviction.getDirCandidate(mStorageDirs, pinList, 300);
Assert.assertEquals(mStorageDirs[2], lruResult.getFirst());
Assert.assertEquals(1, lruResult.getSecond().size());
Assert.assertEquals(lruResult.getSecond().get(0).getBlockId(), BlockInfo.computeBlockId(3, 0));
eviction = new EvictLRU(false);
lruResult = eviction.getDirCandidate(mStorageDirs, pinList, 300);
Assert.assertEquals(mStorageDirs[0], lruResult.getFirst());
Assert.assertEquals(1, lruResult.getSecond().size());
Assert.assertEquals(lruResult.getSecond().get(0).getBlockId(), BlockInfo.computeBlockId(1, 0));
lruResult = eviction.getDirCandidate(mStorageDirs, pinList, 1001);
Assert.assertEquals(null, lruResult);
}