ReplicaMap { ReplicaInfo get(String bpid, Block block) { checkBlockPool(bpid); checkBlock(block); ReplicaInfo replicaInfo = get(bpid, block.getBlockId()); if (replicaInfo != null && block.getGenerationStamp() == replicaInfo.getGenerationStamp()) { return replicaInfo; } return null; } ReplicaMap(Object mutex);   }
@Test public void testGet() { try { map.get(bpid, null); fail("Expected exception not thrown"); } catch (IllegalArgumentException expected) { } assertNotNull(map.get(bpid, block)); Block b = new Block(block); b.setGenerationStampNoPersistance(0); assertNull(map.get(bpid, b)); b.setGenerationStampNoPersistance(block.getGenerationStamp()); b.setBlockIdNoPersistance(0); assertNull(map.get(bpid, b)); assertNotNull(map.get(bpid, block.getBlockId())); assertNull(map.get(bpid, 0)); }