### Question:
GoalStatus extends Message { public static GoalStatus fromJsonObject(JsonObject jsonObject) { GoalID goalID = jsonObject.containsKey(GoalStatus.FIELD_GOAL_ID) ? GoalID .fromJsonObject(jsonObject .getJsonObject(GoalStatus.FIELD_GOAL_ID)) : new GoalID(); byte status = jsonObject.containsKey(GoalStatus.FIELD_STATUS) ? Primitive .toUInt8((short) jsonObject.getInt(GoalStatus.FIELD_STATUS)) : 0; String text = jsonObject.containsKey(GoalStatus.FIELD_TEXT) ? jsonObject .getString(GoalStatus.FIELD_TEXT) : ""; return new GoalStatus(goalID, status, text); } GoalStatus();  GoalStatus(GoalID goalID, byte status, String text); GoalID getGoalID(); byte getStatus(); String getText(); @Override GoalStatus clone(); static GoalStatus fromJsonString(String jsonString); static GoalStatus fromMessage(Message m); static GoalStatus fromJsonObject(JsonObject jsonObject); static final String FIELD_GOAL_ID; static final String FIELD_STATUS; static final String FIELD_TEXT; static final String TYPE; static final byte PENDING; static final byte ACTIVE; static final byte PREEMPTED; static final byte SUCCEEDED; static final byte ABORTED; static final byte REJECTED; static final byte PREEMPTING; static final byte RECALLING; static final byte RECALLED; static final byte LOST; }### Answer:
@Test public void testFromJsonObject() { JsonObject jsonObject = Json.createObjectBuilder() .add(GoalStatus.FIELD_GOAL_ID, g1.getGoalID().toJsonObject()) .add(GoalStatus.FIELD_STATUS, g1.getStatus()) .add(GoalStatus.FIELD_TEXT, g1.getText()).build(); GoalStatus p = GoalStatus.fromJsonObject(jsonObject); assertEquals(g1.toString(), p.toString()); assertEquals(g1.toJsonObject(), p.toJsonObject()); assertEquals(g1.getMessageType(), p.getMessageType()); assertEquals(g1.getGoalID(), p.getGoalID()); assertEquals(g1.getStatus(), p.getStatus()); assertEquals(g1.getText(), p.getText()); assertNotSame(g1, p); assertNotSame(g1.toString(), p.toString()); assertNotSame(g1.toJsonObject(), p.toJsonObject()); }