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