### Question:
Int16MultiArray extends Message { public static Int16MultiArray fromJsonObject(JsonObject jsonObject) { MultiArrayLayout layout = jsonObject .containsKey(Int16MultiArray.FIELD_LAYOUT) ? MultiArrayLayout .fromJsonObject(jsonObject .getJsonObject(Int16MultiArray.FIELD_LAYOUT)) : new MultiArrayLayout(); short[] data = new short[] {}; JsonArray jsonData = jsonObject .getJsonArray(Int16MultiArray.FIELD_DATA); if (jsonData != null) { data = new short[jsonData.size()]; for (int i = 0; i < data.length; i++) { data[i] = (short) jsonData.getInt(i); } } return new Int16MultiArray(layout, data); } Int16MultiArray();  Int16MultiArray(MultiArrayLayout layout, short[] data); MultiArrayLayout getLayout(); int size(); short get(int index); short[] getData(); @Override Int16MultiArray clone(); static Int16MultiArray fromJsonString(java.lang.String jsonString); static Int16MultiArray fromMessage(Message m); static Int16MultiArray 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 (short d : a1.getData()) { array.add(d); } JsonObject jsonObject = Json .createObjectBuilder() .add(Int16MultiArray.FIELD_DATA, array.build()) .add(Int16MultiArray.FIELD_LAYOUT, a1.getLayout().toJsonObject()).build(); Int16MultiArray p = Int16MultiArray.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()); }