### Question:
Wrench extends Message { public static Wrench fromJsonObject(JsonObject jsonObject) { Vector3 force = jsonObject.containsKey(Wrench.FIELD_FORCE) ? Vector3 .fromJsonObject(jsonObject.getJsonObject(Wrench.FIELD_FORCE)) : new Vector3(); Vector3 torque = jsonObject.containsKey(Wrench.FIELD_TORQUE) ? Vector3 .fromJsonObject(jsonObject.getJsonObject(Wrench.FIELD_TORQUE)) : new Vector3(); return new Wrench(force, torque); } Wrench();  Wrench(Vector3 force, Vector3 torque); Vector3 getForce(); Vector3 getTorque(); @Override Wrench clone(); static Wrench fromJsonString(String jsonString); static Wrench fromMessage(Message m); static Wrench fromJsonObject(JsonObject jsonObject); static final String FIELD_FORCE; static final String FIELD_TORQUE; static final String TYPE; }### Answer:
@Test public void testFromJsonObject() { JsonObject jsonObject = Json.createObjectBuilder() .add(Wrench.FIELD_FORCE, w1.getForce().toJsonObject()) .add(Wrench.FIELD_TORQUE, w1.getTorque().toJsonObject()) .build(); Wrench p = Wrench.fromJsonObject(jsonObject); assertEquals(w1.toString(), p.toString()); assertEquals(w1.toJsonObject(), p.toJsonObject()); assertEquals(w1.getMessageType(), p.getMessageType()); assertEquals(w1.getForce(), p.getForce()); assertEquals(w1.getTorque(), p.getTorque()); assertNotSame(w1, p); assertNotSame(w1.toString(), p.toString()); assertNotSame(w1.toJsonObject(), p.toJsonObject()); }