@Override
  public boolean equals(Object obj)
  {
    if (obj instanceof IdEntityResponse)
    {
      IdEntityResponse<?, ?> that = (IdEntityResponse<?, ?>) obj;
      return super.equals(that) &&
          (this._entity == null ? that._entity == null : this._entity.equals(that._entity));
    }
    else
    {
      return false;
    }
  }
@Test
  public void testEquals()
  {
    IdEntityResponse<Long, AnyRecord> longIdEntityResponse1 = new IdEntityResponse<>(1L, new AnyRecord());
    IdEntityResponse<Long, AnyRecord> longIdEntityResponse2 = new IdEntityResponse<>(1L, new AnyRecord());
    IdEntityResponse<Long, AnyRecord> nullLongResponse = new IdEntityResponse<>(null, new AnyRecord());
    IdEntityResponse<String, AnyRecord> nullStringResponse = new IdEntityResponse<>(null, new AnyRecord());
    IdEntityResponse<String, AnyRecord> stringResponse = new IdEntityResponse<>("hello", new AnyRecord());

    // equals and non-null.
    Assert.assertTrue(longIdEntityResponse1.equals(longIdEntityResponse2));

    // equals and null
    Assert.assertTrue(nullLongResponse.equals(nullStringResponse));
    Assert.assertTrue(nullStringResponse.equals(nullLongResponse));

    // unequal and non-null
    Assert.assertFalse(longIdEntityResponse1.equals(stringResponse));

    // unequal and one null
    Assert.assertFalse(longIdEntityResponse1.equals(nullLongResponse));
    Assert.assertFalse(nullLongResponse.equals(longIdEntityResponse1));
  }