### Question:
ReadOnlyRowId extends RowId { @Override public boolean equals(Object obj) { if (obj == null || !(ReadOnlyRowId.class.equals(obj.getClass()))) { return false; } return getRowNum() == (((ReadOnlyRowId) obj).getRowNum()); } ReadOnlyRowId(int rowNum); @Override int hashCode(); @Override boolean equals(Object obj); int getRowNum(); @Override String toString();  }### Answer:
@Test public void equals_compareWithNull_shouldBeFalse() { ReadOnlyRowId rid = new ReadOnlyRowId(1337); Assert.assertFalse(rid.equals(null)); }
@Test public void equals_compareWithSameInstance_shouldBeTrue() { ReadOnlyRowId rid = new ReadOnlyRowId(1337); ReadOnlyRowId rid2 = rid; Assert.assertTrue(rid.equals(rid2)); }
@Test public void equals_compareWithOtherType_shouldBeFalse() { ReadOnlyRowId rid = new ReadOnlyRowId(1337); Assert.assertFalse(rid.equals(new Object())); }
@Test public void equals_compareWithOtherRowId_shouldBeFalse() { ReadOnlyRowId rid = new ReadOnlyRowId(1337); ReadOnlyRowId rid2 = new ReadOnlyRowId(42); Assert.assertFalse(rid.equals(rid2)); }
@Test public void equals_compareWithNull_shouldBeFalse() { ReadOnlyRowId rid = new ReadOnlyRowId(1337); assertFalse(rid.equals(null)); }
@Test public void equals_compareWithSameInstance_shouldBeTrue() { ReadOnlyRowId rid = new ReadOnlyRowId(1337); ReadOnlyRowId rid2 = rid; assertTrue(rid.equals(rid2)); }
@Test public void equals_compareWithOtherType_shouldBeFalse() { ReadOnlyRowId rid = new ReadOnlyRowId(1337); assertFalse(rid.equals(new Object())); }
@Test public void equals_compareWithOtherRowId_shouldBeFalse() { ReadOnlyRowId rid = new ReadOnlyRowId(1337); ReadOnlyRowId rid2 = new ReadOnlyRowId(42); assertFalse(rid.equals(rid2)); }