@Test public void hashCodeOfDifferentEventCode() { Event event1 = new Event(new UINT16(0), SESSION_ID, TRANSACTION_ID, P1, P2, P3); Event event2 = new Event(new UINT16(1), SESSION_ID, TRANSACTION_ID, P1, P2, P3); assertThat(event1.hashCode(), not(event2.hashCode())); }
@Override public int hashCode() { return new HashCodeBuilder() .append(eventCode) .append(sessionID) .append(transactionID) .append(p1) .append(p2) .append(p3) .toHashCode(); }
Event { @Override public int hashCode() { return new HashCodeBuilder() .append(eventCode) .append(sessionID) .append(transactionID) .append(p1) .append(p2) .append(p3) .toHashCode(); } }
Event { @Override public int hashCode() { return new HashCodeBuilder() .append(eventCode) .append(sessionID) .append(transactionID) .append(p1) .append(p2) .append(p3) .toHashCode(); } Event(UINT16 eventCode, UINT32 sessionID, UINT32 transactionID);  Event(UINT16 eventCode, UINT32 sessionID, UINT32 transactionID, UINT32 p1);  Event(UINT16 eventCode, UINT32 sessionID, UINT32 transactionID, UINT32 p1, UINT32 p2);  Event(UINT16 eventCode, UINT32 sessionID, UINT32 transactionID, UINT32 p1, UINT32 p2, UINT32 p3); }
Event { @Override public int hashCode() { return new HashCodeBuilder() .append(eventCode) .append(sessionID) .append(transactionID) .append(p1) .append(p2) .append(p3) .toHashCode(); } Event(UINT16 eventCode, UINT32 sessionID, UINT32 transactionID);  Event(UINT16 eventCode, UINT32 sessionID, UINT32 transactionID, UINT32 p1);  Event(UINT16 eventCode, UINT32 sessionID, UINT32 transactionID, UINT32 p1, UINT32 p2);  Event(UINT16 eventCode, UINT32 sessionID, UINT32 transactionID, UINT32 p1, UINT32 p2, UINT32 p3); UINT16 getEventCode(); UINT32 getSessionID(); UINT32 getTransactionID(); UINT32 getP1(); UINT32 getP2(); UINT32 getP3(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
Event { @Override public int hashCode() { return new HashCodeBuilder() .append(eventCode) .append(sessionID) .append(transactionID) .append(p1) .append(p2) .append(p3) .toHashCode(); } Event(UINT16 eventCode, UINT32 sessionID, UINT32 transactionID);  Event(UINT16 eventCode, UINT32 sessionID, UINT32 transactionID, UINT32 p1);  Event(UINT16 eventCode, UINT32 sessionID, UINT32 transactionID, UINT32 p1, UINT32 p2);  Event(UINT16 eventCode, UINT32 sessionID, UINT32 transactionID, UINT32 p1, UINT32 p2, UINT32 p3); UINT16 getEventCode(); UINT32 getSessionID(); UINT32 getTransactionID(); UINT32 getP1(); UINT32 getP2(); UINT32 getP3(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }