@Override // Object
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (!(o instanceof ExtendedBlock)) {
      return false;
    }
    ExtendedBlock b = (ExtendedBlock)o;
    return b.block.equals(block) &&
        (b.poolId != null ? b.poolId.equals(poolId) : poolId == null);
  }
@Test
  public void testEquals() {
    // Same block -> equal
    assertEquals(
        new ExtendedBlock(POOL_A, BLOCK_1_GS1),
        new ExtendedBlock(POOL_A, BLOCK_1_GS1));
    // Different pools, same block id -> not equal
    assertNotEquals(
        new ExtendedBlock(POOL_A, BLOCK_1_GS1),
        new ExtendedBlock(POOL_B, BLOCK_1_GS1));
    // Same pool, different block id -> not equal
    assertNotEquals(
        new ExtendedBlock(POOL_A, BLOCK_1_GS1),
        new ExtendedBlock(POOL_A, BLOCK_2_GS1));
    // Same block, different genstamps -> equal
    assertEquals(
        new ExtendedBlock(POOL_A, BLOCK_1_GS1),
        new ExtendedBlock(POOL_A, BLOCK_1_GS2));
  }