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