### Question:
Int32MultiArray extends Message { public static Int32MultiArray fromJsonObject(JsonObject jsonObject) { MultiArrayLayout layout = jsonObject .containsKey(Int32MultiArray.FIELD_LAYOUT) ? MultiArrayLayout .fromJsonObject(jsonObject .getJsonObject(Int32MultiArray.FIELD_LAYOUT)) : new MultiArrayLayout(); int[] data = new int[] {}; JsonArray jsonData = jsonObject .getJsonArray(Int32MultiArray.FIELD_DATA); if (jsonData != null) { data = new int[jsonData.size()]; for (int i = 0; i < data.length; i++) { data[i] = jsonData.getInt(i); } } return new Int32MultiArray(layout, data); } Int32MultiArray();  Int32MultiArray(MultiArrayLayout layout, int[] data); MultiArrayLayout getLayout(); int size(); int get(int index); int[] getData(); @Override Int32MultiArray clone(); static Int32MultiArray fromJsonString(java.lang.String jsonString); static Int32MultiArray fromMessage(Message m); static Int32MultiArray fromJsonObject(JsonObject jsonObject); static final java.lang.String FIELD_LAYOUT; static final java.lang.String FIELD_DATA; static final java.lang.String TYPE; }### Answer:
@Test public void testFromJsonObject() { JsonArrayBuilder array = Json.createArrayBuilder(); for (int d : a1.getData()) { array.add(d); } JsonObject jsonObject = Json .createObjectBuilder() .add(Int32MultiArray.FIELD_DATA, array.build()) .add(Int32MultiArray.FIELD_LAYOUT, a1.getLayout().toJsonObject()).build(); Int32MultiArray p = Int32MultiArray.fromJsonObject(jsonObject); assertEquals(a1.toString(), p.toString()); assertEquals(a1.toJsonObject(), p.toJsonObject()); assertEquals(a1.getMessageType(), p.getMessageType()); assertTrue(Arrays.equals(a1.getData(), p.getData())); assertEquals(a1.getLayout(), p.getLayout()); assertNotSame(a1, p); assertNotSame(a1.toString(), p.toString()); assertNotSame(a1.toJsonObject(), p.toJsonObject()); assertEquals(a1.size(), p.size()); }