### Question:
PoseWithCovarianceStamped extends Message { public static PoseWithCovarianceStamped fromJsonObject(JsonObject jsonObject) { Header header = jsonObject .containsKey(PoseWithCovarianceStamped.FIELD_HEADER) ? Header .fromJsonObject(jsonObject .getJsonObject(PoseWithCovarianceStamped.FIELD_HEADER)) : new Header(); PoseWithCovariance pose = jsonObject .containsKey(PoseWithCovarianceStamped.FIELD_POSE) ? PoseWithCovariance .fromJsonObject(jsonObject .getJsonObject(PoseWithCovarianceStamped.FIELD_POSE)) : new PoseWithCovariance(); return new PoseWithCovarianceStamped(header, pose); } PoseWithCovarianceStamped();  PoseWithCovarianceStamped(Header header, PoseWithCovariance pose); Header getHeader(); PoseWithCovariance getPose(); @Override PoseWithCovarianceStamped clone(); static PoseWithCovarianceStamped fromJsonString(String jsonString); static PoseWithCovarianceStamped fromMessage(Message m); static PoseWithCovarianceStamped 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(PoseWithCovarianceStamped.FIELD_HEADER, p1.getHeader().toJsonObject()) .add(PoseWithCovarianceStamped.FIELD_POSE, p1.getPose().toJsonObject()).build(); PoseWithCovarianceStamped p = PoseWithCovarianceStamped .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()); }