MessageFromClient { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final MessageFromClient other = (MessageFromClient) obj; return Objects.equals(this.id, other.id); }  String getId(); void setId(String messageId); String getDataService(); void setDataService(String dataService); String getOperation(); void setOperation(String operation); List<String> getParameters(); void setParameters(List<String> parameters); @Override int hashCode(); @Override boolean equals(Object obj); static MessageFromClient createFromJson(String json);  }
@Test public void testEquals() { System.out.println("testEquals"); String expResult = UUID.randomUUID().toString(); MessageFromClient msg = new MessageFromClient(); msg.setId(expResult); MessageFromClient test = null; assertThat(msg.equals(test)).isFalse(); assertThat(msg.equals("NotSameClass")).isFalse(); test = new MessageFromClient(); test.setId(UUID.randomUUID().toString()); assertThat(msg.equals(test)).isFalse(); test.setId(expResult); assertThat(msg.equals(test)).isTrue(); }