### Question:
Transform extends Message { public static Transform fromJsonObject(JsonObject jsonObject) { Vector3 translation = jsonObject.containsKey(Transform.FIELD_TRANSLATION) ? Vector3 .fromJsonObject(jsonObject.getJsonObject(Transform.FIELD_TRANSLATION)) : new Vector3(); Quaternion rotation = jsonObject.containsKey(Transform.FIELD_ROTATION) ? Quaternion .fromJsonObject(jsonObject .getJsonObject(Transform.FIELD_ROTATION)) : new Quaternion(); return new Transform(translation, rotation); } Transform();  Transform(Vector3 translation, Quaternion rotation); Vector3 getTranslation(); Quaternion getRotation(); @Override Transform clone(); static Transform fromJsonString(String jsonString); static Transform fromMessage(Message m); static Transform fromJsonObject(JsonObject jsonObject); static final String FIELD_TRANSLATION; static final String FIELD_ROTATION; static final String TYPE; }### Answer:
@Test public void testFromJsonObject() { JsonObject jsonObject = Json .createObjectBuilder() .add(Transform.FIELD_TRANSLATION, t1.getTranslation().toJsonObject()) .add(Transform.FIELD_ROTATION, t1.getRotation().toJsonObject()) .build(); Transform p = Transform.fromJsonObject(jsonObject); assertEquals(t1.toString(), p.toString()); assertEquals(t1.toJsonObject(), p.toJsonObject()); assertEquals(t1.getMessageType(), p.getMessageType()); assertEquals(t1.getTranslation(), p.getTranslation()); assertEquals(t1.getRotation(), p.getRotation()); assertNotSame(t1, p); assertNotSame(t1.toString(), p.toString()); assertNotSame(t1.toJsonObject(), p.toJsonObject()); }