### Question:
Vector3 extends Message { public static Vector3 fromJsonObject(JsonObject jsonObject) { double x = jsonObject.containsKey(Vector3.FIELD_X) ? jsonObject .getJsonNumber(Vector3.FIELD_X).doubleValue() : 0.0; double y = jsonObject.containsKey(Vector3.FIELD_Y) ? jsonObject .getJsonNumber(Vector3.FIELD_Y).doubleValue() : 0.0; double z = jsonObject.containsKey(Vector3.FIELD_Z) ? jsonObject .getJsonNumber(Vector3.FIELD_Z).doubleValue() : 0.0; return new Vector3(x, y, z); } Vector3();  Vector3(double x, double y, double z); double getX(); double getY(); double getZ(); @Override Vector3 clone(); static Vector3 fromJsonString(String jsonString); static Vector3 fromMessage(Message m); static Vector3 fromJsonObject(JsonObject jsonObject); static final String FIELD_X; static final String FIELD_Y; static final String FIELD_Z; static final String TYPE; }### Answer:
@Test public void testFromJsonObject() { JsonObject jsonObject = Json.createObjectBuilder() .add(Vector3.FIELD_X, v1.getX()) .add(Vector3.FIELD_Y, v1.getY()) .add(Vector3.FIELD_Z, v1.getZ()).build(); Vector3 p = Vector3.fromJsonObject(jsonObject); assertEquals(v1.toString(), p.toString()); assertEquals(v1.toJsonObject(), p.toJsonObject()); assertEquals(v1.getMessageType(), p.getMessageType()); assertEquals(v1.getX(), p.getX(), 0); assertEquals(v1.getY(), p.getY(), 0); assertEquals(v1.getZ(), p.getZ(), 0); assertNotSame(v1, p); assertNotSame(v1.toString(), p.toString()); assertNotSame(v1.toJsonObject(), p.toJsonObject()); }