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