### Question:
RowId implements Serializable { @Override public int hashCode() { return Arrays.hashCode(getId()); } protected  RowId();  RowId(Object... id); Object[] getId(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }### Answer:
@Test public void hashCode_samePrimaryKeys_sameResult() { RowId id = new RowId(new Object[] { "id", "name" }); RowId id2 = new RowId(new Object[] { "id", "name" }); Assert.assertEquals(id.hashCode(), id2.hashCode()); }
@Test public void hashCode_differentPrimaryKeys_differentResult() { RowId id = new RowId(new Object[] { "id", "name" }); RowId id2 = new RowId(new Object[] { "id" }); Assert.assertFalse(id.hashCode() == id2.hashCode()); }
@Test public void hashCode_samePrimaryKeys_sameResult() { RowId id = new RowId(new Object[] { "id", "name" }); RowId id2 = new RowId(new Object[] { "id", "name" }); assertEquals(id.hashCode(), id2.hashCode()); }
@Test public void hashCode_differentPrimaryKeys_differentResult() { RowId id = new RowId(new Object[] { "id", "name" }); RowId id2 = new RowId(new Object[] { "id" }); assertFalse(id.hashCode() == id2.hashCode()); }