### Question:
Point extends Message { public static Point fromJsonObject(JsonObject jsonObject) { double x = jsonObject.containsKey(Point.FIELD_X) ? jsonObject .getJsonNumber(Point.FIELD_X).doubleValue() : 0.0; double y = jsonObject.containsKey(Point.FIELD_Y) ? jsonObject .getJsonNumber(Point.FIELD_Y).doubleValue() : 0.0; double z = jsonObject.containsKey(Point.FIELD_Z) ? jsonObject .getJsonNumber(Point.FIELD_Z).doubleValue() : 0.0; return new Point(x, y, z); } Point();  Point(double x, double y, double z); double getX(); double getY(); double getZ(); @Override Point clone(); static Point fromJsonString(String jsonString); static Point fromMessage(Message m); static Point 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(Point.FIELD_X, p1.getX()).add(Point.FIELD_Y, p1.getY()) .add(Point.FIELD_Z, p1.getZ()).build(); Point p = Point.fromJsonObject(jsonObject); assertEquals(p1.toString(), p.toString()); assertEquals(p1.toJsonObject(), p.toJsonObject()); assertEquals(p1.getMessageType(), p.getMessageType()); assertEquals(p1.getX(), p.getX(), 0); assertEquals(p1.getY(), p.getY(), 0); assertEquals(p1.getZ(), p.getZ(), 0); assertNotSame(p1, p); assertNotSame(p1.toString(), p.toString()); assertNotSame(p1.toJsonObject(), p.toJsonObject()); }