MessageFromClient { public static MessageFromClient createFromJson(String json) { MessageFromClient message = new MessageFromClient(); try (JsonReader reader = Json.createReader(new StringReader(json))) { JsonObject root = reader.readObject(); message.setId(root.getString(Constants.Message.ID)); message.setDataService(root.getString(Constants.Message.DATASERVICE)); message.setOperation(root.getString(Constants.Message.OPERATION)); logger.debug("Get arguments from message '{}'", json); message.setParameters(getArgumentsFromMessage(root.getJsonArray(Constants.Message.ARGUMENTS))); } return message; }  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 createFromJsonTest() { System.out.println("createFromJson"); String json = mfcToJson(msgWithArg); MessageFromClient mfc = MessageFromClient.createFromJson(json); assertThat(mfc).isEqualToComparingFieldByField(msgWithArg); }