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