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