### Question:
WrenchStamped extends Message { public static WrenchStamped fromJsonObject(JsonObject jsonObject) { Header header = jsonObject.containsKey(WrenchStamped.FIELD_HEADER) ? Header .fromJsonObject(jsonObject .getJsonObject(WrenchStamped.FIELD_HEADER)) : new Header(); Wrench wrench = jsonObject.containsKey(WrenchStamped.FIELD_WRENCH) ? Wrench .fromJsonObject(jsonObject .getJsonObject(WrenchStamped.FIELD_WRENCH)) : new Wrench(); return new WrenchStamped(header, wrench); } WrenchStamped();  WrenchStamped(Header header, Wrench wrench); Header getHeader(); Wrench getWrench(); @Override WrenchStamped clone(); static WrenchStamped fromJsonString(String jsonString); static WrenchStamped fromMessage(Message m); static WrenchStamped fromJsonObject(JsonObject jsonObject); static final String FIELD_HEADER; static final String FIELD_WRENCH; static final String TYPE; }### Answer:
@Test public void testFromJsonObject() { JsonObject jsonObject = Json.createObjectBuilder() .add(WrenchStamped.FIELD_HEADER, w1.getHeader().toJsonObject()) .add(WrenchStamped.FIELD_WRENCH, w1.getWrench().toJsonObject()) .build(); WrenchStamped p = WrenchStamped.fromJsonObject(jsonObject); assertEquals(w1.toString(), p.toString()); assertEquals(w1.toJsonObject(), p.toJsonObject()); assertEquals(w1.getMessageType(), p.getMessageType()); assertEquals(w1.getHeader(), p.getHeader()); assertEquals(w1.getWrench(), p.getWrench()); assertNotSame(w1, p); assertNotSame(w1.toString(), p.toString()); assertNotSame(w1.toJsonObject(), p.toJsonObject()); }