@Test
public void testRemove() {

  // Test 1: null argument throws invalid argument exception
  try {
    map.remove(bpid, null);
    fail("Expected exception not thrown");
  } catch (IllegalArgumentException expected) { }
  
  // Test 2: remove failure - generation stamp mismatch 
  Block b = new Block(block);
  b.setGenerationStamp(0);
  assertNull(map.remove(bpid, b));
  
  // Test 3: remove failure - blockID mismatch
  b.setGenerationStamp(block.getGenerationStamp());
  b.setBlockId(0);
  assertNull(map.remove(bpid, b));
  
  // Test 4: remove success
  assertNotNull(map.remove(bpid, block));
  
  // Test 5: remove failure - invalid blockID
  assertNull(map.remove(bpid, 0));
  
  // Test 6: remove success
  map.add(bpid, new FinalizedReplica(block, null, null));
  assertNotNull(map.remove(bpid, block.getBlockId()));
}