MessageToClient { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final MessageToClient other = (MessageToClient) obj; return Objects.equals(this.id, other.id); }  String getJson(); void setJson(String json); MessageType getType(); void setType(MessageType type); String getId(); void setId(String id); Object getResponse(); void setConstraints(ConstraintViolation[] response); void setResult(Object response); void setFault(Object response); void setResponse(Object response); long getDeadline(); void setDeadline(long deadline); long getTime(); void setTime(long time); @Override int hashCode(); @Override boolean equals(Object obj); String toJson(); @Override String toString();  }
@Test public void testEquals() { System.out.println("testEquals"); String expResult = UUID.randomUUID().toString(); MessageToClient msg = new MessageToClient(); msg.setId(expResult); MessageToClient test = null; assertThat(msg.equals(test)).isFalse(); assertThat(msg.equals("NotSameClass")).isFalse(); test = new MessageToClient(); test.setId(UUID.randomUUID().toString()); assertThat(msg.equals(test)).isFalse(); test.setId(expResult); assertThat(msg.equals(test)).isTrue(); }