@Test public void hashCodeOfDifferentSessionID() { Response response1 = new Response(RESPONSE_CODE, new UINT32(0), TRANSACTION_ID, P1, P2, P3, P4, P5); Response response2 = new Response(RESPONSE_CODE, new UINT32(1), TRANSACTION_ID, P1, P2, P3, P4, P5); assertThat(response1.hashCode(), not(response2.hashCode())); }
@Override public int hashCode() { return new HashCodeBuilder() .append(responseCode) .append(sessionID) .append(transactionID) .append(p1) .append(p2) .append(p3) .append(p4) .append(p5) .toHashCode(); }
Response { @Override public int hashCode() { return new HashCodeBuilder() .append(responseCode) .append(sessionID) .append(transactionID) .append(p1) .append(p2) .append(p3) .append(p4) .append(p5) .toHashCode(); } }
Response { @Override public int hashCode() { return new HashCodeBuilder() .append(responseCode) .append(sessionID) .append(transactionID) .append(p1) .append(p2) .append(p3) .append(p4) .append(p5) .toHashCode(); } Response(UINT16 responseCode, UINT32 sessionID, UINT32 transactionID);  Response(UINT16 responseCode, UINT32 sessionID, UINT32 transactionID, UINT32 p1);  Response(UINT16 responseCode, UINT32 sessionID, UINT32 transactionID, UINT32 p1, UINT32 p2);  Response(UINT16 responseCode, UINT32 sessionID, UINT32 transactionID, UINT32 p1, UINT32 p2, UINT32 p3);  Response(UINT16 responseCode, UINT32 sessionID, UINT32 transactionID, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4);  Response(UINT16 responseCode, UINT32 sessionID, UINT32 transactionID, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4, UINT32 p5); }
Response { @Override public int hashCode() { return new HashCodeBuilder() .append(responseCode) .append(sessionID) .append(transactionID) .append(p1) .append(p2) .append(p3) .append(p4) .append(p5) .toHashCode(); } Response(UINT16 responseCode, UINT32 sessionID, UINT32 transactionID);  Response(UINT16 responseCode, UINT32 sessionID, UINT32 transactionID, UINT32 p1);  Response(UINT16 responseCode, UINT32 sessionID, UINT32 transactionID, UINT32 p1, UINT32 p2);  Response(UINT16 responseCode, UINT32 sessionID, UINT32 transactionID, UINT32 p1, UINT32 p2, UINT32 p3);  Response(UINT16 responseCode, UINT32 sessionID, UINT32 transactionID, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4);  Response(UINT16 responseCode, UINT32 sessionID, UINT32 transactionID, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4, UINT32 p5); UINT16 getResponseCode(); UINT32 getSessionID(); UINT32 getTransactionID(); UINT32 getP1(); UINT32 getP2(); UINT32 getP3(); UINT32 getP4(); UINT32 getP5(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
Response { @Override public int hashCode() { return new HashCodeBuilder() .append(responseCode) .append(sessionID) .append(transactionID) .append(p1) .append(p2) .append(p3) .append(p4) .append(p5) .toHashCode(); } Response(UINT16 responseCode, UINT32 sessionID, UINT32 transactionID);  Response(UINT16 responseCode, UINT32 sessionID, UINT32 transactionID, UINT32 p1);  Response(UINT16 responseCode, UINT32 sessionID, UINT32 transactionID, UINT32 p1, UINT32 p2);  Response(UINT16 responseCode, UINT32 sessionID, UINT32 transactionID, UINT32 p1, UINT32 p2, UINT32 p3);  Response(UINT16 responseCode, UINT32 sessionID, UINT32 transactionID, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4);  Response(UINT16 responseCode, UINT32 sessionID, UINT32 transactionID, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4, UINT32 p5); UINT16 getResponseCode(); UINT32 getSessionID(); UINT32 getTransactionID(); UINT32 getP1(); UINT32 getP2(); UINT32 getP3(); UINT32 getP4(); UINT32 getP5(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }