### Question:
Twist extends Message { public static Twist fromJsonObject(JsonObject jsonObject) { Vector3 linear = jsonObject.containsKey(Twist.FIELD_LINEAR) ? Vector3 .fromJsonObject(jsonObject.getJsonObject(Twist.FIELD_LINEAR)) : new Vector3(); Vector3 angular = jsonObject.containsKey(Twist.FIELD_ANGULAR) ? Vector3 .fromJsonObject(jsonObject.getJsonObject(Twist.FIELD_ANGULAR)) : new Vector3(); return new Twist(linear, angular); } Twist();  Twist(Vector3 linear, Vector3 angular); Vector3 getLinear(); Vector3 getAngular(); @Override Twist clone(); static Twist fromJsonString(String jsonString); static Twist fromMessage(Message m); static Twist fromJsonObject(JsonObject jsonObject); static final String FIELD_LINEAR; static final String FIELD_ANGULAR; static final String TYPE; }### Answer:
@Test public void testFromJsonObject() { JsonObject jsonObject = Json.createObjectBuilder() .add(Twist.FIELD_LINEAR, t1.getLinear().toJsonObject()) .add(Twist.FIELD_ANGULAR, t1.getAngular().toJsonObject()) .build(); Twist p = Twist.fromJsonObject(jsonObject); assertEquals(t1.toString(), p.toString()); assertEquals(t1.toJsonObject(), p.toJsonObject()); assertEquals(t1.getMessageType(), p.getMessageType()); assertEquals(t1.getLinear(), p.getLinear()); assertEquals(t1.getAngular(), p.getAngular()); assertNotSame(t1, p); assertNotSame(t1.toString(), p.toString()); assertNotSame(t1.toJsonObject(), p.toJsonObject()); }