### Question:
GoalStatusArray extends Message { public static GoalStatusArray fromJsonObject(JsonObject jsonObject) { Header header = jsonObject.containsKey(GoalStatusArray.FIELD_HEADER) ? Header .fromJsonObject(jsonObject .getJsonObject(GoalStatusArray.FIELD_HEADER)) : new Header(); JsonArray jsonPoses = jsonObject .getJsonArray(GoalStatusArray.FIELD_STATUS_LIST); if (jsonPoses != null) { GoalStatus[] statuses = new GoalStatus[jsonPoses.size()]; for (int i = 0; i < statuses.length; i++) { statuses[i] = GoalStatus.fromJsonObject(jsonPoses .getJsonObject(i)); } return new GoalStatusArray(header, statuses); } else { return new GoalStatusArray(header, new GoalStatus[] {}); } } GoalStatusArray();  GoalStatusArray(Header header, GoalStatus[] statusList); int size(); GoalStatus get(int index); GoalStatus[] getStatusList(); Header getHeader(); @Override GoalStatusArray clone(); static GoalStatusArray fromJsonString(String jsonString); static GoalStatusArray fromMessage(Message m); static GoalStatusArray fromJsonObject(JsonObject jsonObject); static final String FIELD_HEADER; static final String FIELD_STATUS_LIST; static final String TYPE; }### Answer:
@Test public void testFromJsonObject() { JsonArrayBuilder array = Json.createArrayBuilder(); for (GoalStatus p : g1.getStatusList()) { array.add(p.toJsonObject()); } JsonObject jsonObject = Json .createObjectBuilder() .add(GoalStatusArray.FIELD_HEADER, g1.getHeader().toJsonObject()) .add(GoalStatusArray.FIELD_STATUS_LIST, array.build()).build(); GoalStatusArray p = GoalStatusArray.fromJsonObject(jsonObject); assertEquals(g1.toString(), p.toString()); assertEquals(g1.toJsonObject(), p.toJsonObject()); assertEquals(g1.getMessageType(), p.getMessageType()); assertEquals(g1.size(), p.size()); assertEquals(g1.getHeader(), p.getHeader()); assertTrue(Arrays.deepEquals(g1.getStatusList(), p.getStatusList())); assertNotSame(g1, p); assertNotSame(g1.toString(), p.toString()); assertNotSame(g1.toJsonObject(), p.toJsonObject()); }