### Question:
MatrixElement { @Override public int hashCode() { return this.getRow() ^ this.getColumn(); } MatrixElement(final int row, final int col, final double value); Integer getRow(); Integer getColumn(); Double getValue(); @Override int hashCode(); @Override boolean equals(final Object obj);  }### Answer:
@Test public void hashCodesAreEqualForEquivalentObjects() { final MatrixElement element = new MatrixElement(5, 4, 7.0); final int hashCode = element.hashCode(); MatcherAssert.assertThat( DESC_TO_ELEMENT_MAP.get("default").hashCode(), IsEqual.equalTo(hashCode)); MatcherAssert.assertThat( DESC_TO_ELEMENT_MAP.get("diff-row").hashCode(), IsNot.not(IsEqual.equalTo(hashCode))); MatcherAssert.assertThat( DESC_TO_ELEMENT_MAP.get("diff-col").hashCode(), IsNot.not(IsEqual.equalTo(hashCode))); MatcherAssert.assertThat( DESC_TO_ELEMENT_MAP.get("diff-val").hashCode(), IsEqual.equalTo(hashCode)); }