@Test public void testEquals() { new EqualsTester() .addEqualityGroup(message1, sameAsMessage1) .addEqualityGroup(message2) .addEqualityGroup(message3) .testEquals(); }
@Override public boolean equals(Object o) { if (!(o instanceof ClusterMessage)) { return false; } ClusterMessage that = (ClusterMessage) o; return Objects.equals(this.sender, that.sender) && Objects.equals(this.subject, that.subject) && Arrays.equals(this.payload, that.payload); }
ClusterMessage { @Override public boolean equals(Object o) { if (!(o instanceof ClusterMessage)) { return false; } ClusterMessage that = (ClusterMessage) o; return Objects.equals(this.sender, that.sender) && Objects.equals(this.subject, that.subject) && Arrays.equals(this.payload, that.payload); } }
ClusterMessage { @Override public boolean equals(Object o) { if (!(o instanceof ClusterMessage)) { return false; } ClusterMessage that = (ClusterMessage) o; return Objects.equals(this.sender, that.sender) && Objects.equals(this.subject, that.subject) && Arrays.equals(this.payload, that.payload); } ClusterMessage(NodeId sender, MessageSubject subject, byte[] payload); }
ClusterMessage { @Override public boolean equals(Object o) { if (!(o instanceof ClusterMessage)) { return false; } ClusterMessage that = (ClusterMessage) o; return Objects.equals(this.sender, that.sender) && Objects.equals(this.subject, that.subject) && Arrays.equals(this.payload, that.payload); } ClusterMessage(NodeId sender, MessageSubject subject, byte[] payload); NodeId sender(); MessageSubject subject(); byte[] payload(); void respond(byte[] data); byte[] response(); @Override String toString(); @Override boolean equals(Object o); byte[] getBytes(); static ClusterMessage fromBytes(byte[] bytes); @Override int hashCode(); }
ClusterMessage { @Override public boolean equals(Object o) { if (!(o instanceof ClusterMessage)) { return false; } ClusterMessage that = (ClusterMessage) o; return Objects.equals(this.sender, that.sender) && Objects.equals(this.subject, that.subject) && Arrays.equals(this.payload, that.payload); } ClusterMessage(NodeId sender, MessageSubject subject, byte[] payload); NodeId sender(); MessageSubject subject(); byte[] payload(); void respond(byte[] data); byte[] response(); @Override String toString(); @Override boolean equals(Object o); byte[] getBytes(); static ClusterMessage fromBytes(byte[] bytes); @Override int hashCode();  }