### Question:
DenialReason { @Override public int hashCode() { return Objects.hash(getId(), getReason(), isFraud()); } DenialReason(String id, String reason, boolean fraud); String getId(); String getReason(); boolean isFraud(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void hashCodeEqualWhenSame() { assertEquals(new DenialReason("a", "1", true).hashCode(), new DenialReason("a", "1", true).hashCode()); }
@Test public void hashCodeNotEqualWhenIdIsDifferent() { assertNotEquals(new DenialReason("a", "1", true).hashCode(), new DenialReason("b", "1", true).hashCode()); }
@Test public void hashCodeNotEqualWhenReasonIsDifferent() { assertNotEquals(new DenialReason("a", "1", true).hashCode(), new DenialReason("a", "2", true).hashCode()); }
@Test public void hashCodeNotEqualWhenFraudIsDifferent() { assertNotEquals(new DenialReason("a", "1", true).hashCode(), new DenialReason("a", "1", false).hashCode()); }