### Question:
Pose extends Message { public static Pose fromJsonObject(JsonObject jsonObject) { Point position = jsonObject.containsKey(Pose.FIELD_POSITION) ? Point .fromJsonObject(jsonObject.getJsonObject(Pose.FIELD_POSITION)) : new Point(); Quaternion orientation = jsonObject.containsKey(Pose.FIELD_ORIENTATION) ? Quaternion .fromJsonObject(jsonObject .getJsonObject(Pose.FIELD_ORIENTATION)) : new Quaternion(); return new Pose(position, orientation); } Pose();  Pose(Point position, Quaternion orientation); Point getPosition(); Quaternion getOrientation(); @Override Pose clone(); static Pose fromJsonString(String jsonString); static Pose fromMessage(Message m); static Pose fromJsonObject(JsonObject jsonObject); static final String FIELD_POSITION; static final String FIELD_ORIENTATION; static final String TYPE; }### Answer:
@Test public void testFromJsonObject() { JsonObject jsonObject = Json .createObjectBuilder() .add(Pose.FIELD_POSITION, p1.getPosition().toJsonObject()) .add(Pose.FIELD_ORIENTATION, p1.getOrientation().toJsonObject()) .build(); Pose p = Pose.fromJsonObject(jsonObject); assertEquals(p1.toString(), p.toString()); assertEquals(p1.toJsonObject(), p.toJsonObject()); assertEquals(p1.getMessageType(), p.getMessageType()); assertEquals(p1.getPosition(), p.getPosition()); assertEquals(p1.getOrientation(), p.getOrientation()); assertNotSame(p1, p); assertNotSame(p1.toString(), p.toString()); assertNotSame(p1.toJsonObject(), p.toJsonObject()); }