### Question:
HeapPageId implements PageId { public boolean equals(Object o) { if(o instanceof HeapPageId){ return o.hashCode()==this.hashCode(); } return false; } HeapPageId(int tableId, int pgNo); int getTableId(); int pageNumber(); int hashCode(); boolean equals(Object o); int[] serialize();  }### Answer:
@Test public void equals() { HeapPageId pid1 = new HeapPageId(1, 1); HeapPageId pid1Copy = new HeapPageId(1, 1); HeapPageId pid2 = new HeapPageId(2, 2); assertFalse(pid1.equals(null)); assertFalse(pid1.equals(new Object())); assertTrue(pid1.equals(pid1)); assertTrue(pid1.equals(pid1Copy)); assertTrue(pid1Copy.equals(pid1)); assertTrue(pid2.equals(pid2)); assertFalse(pid1.equals(pid2)); assertFalse(pid1Copy.equals(pid2)); assertFalse(pid2.equals(pid1)); assertFalse(pid2.equals(pid1Copy)); }