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