### Question:
JsonArrayImpl extends AbstractList<JsonValue> implements JsonArray, Serializable { @Override public String toString() { if (unmodifieableBackingList.isEmpty()) { return "[]"; } final StringWriter writer = new StringWriter(); try (final JsonGenerator generator = new JsonGeneratorImpl(writer, provider, false)) { generator.writeStartArray(); unmodifieableBackingList.forEach(generator::write); generator.writeEnd(); } return writer.toString(); } JsonArrayImpl(final List<JsonValue> backingList, final BufferStrategy.BufferProvider<char[]> provider); @Override JsonObject getJsonObject(final int index); @Override JsonArray getJsonArray(final int index); @Override JsonNumber getJsonNumber(final int index); @Override JsonString getJsonString(final int index); @Override List<T> getValuesAs(final Class<T> clazz); @Override String getString(final int index); @Override String getString(final int index, final String defaultValue); @Override int getInt(final int index); @Override int getInt(final int index, final int defaultValue); @Override boolean getBoolean(final int index); @Override boolean getBoolean(final int index, final boolean defaultValue); @Override boolean isNull(final int index); @Override ValueType getValueType(); @Override String toString(); @Override boolean equals(final Object obj); @Override int hashCode(); @Override JsonValue get(final int index); @Override int size(); @Override Iterator<JsonValue> iterator();  }### Answer:
@Test public void arrayToString() { JsonArrayBuilder ab = Json.createArrayBuilder(); ab.add(new JsonStringImpl("a")); ab.add(new JsonStringImpl("b")); assertEquals("[\"a\",\"b\"]", ab.build().toString()); }
@Test public void emptyArray() { final JsonArray array = Json.createArrayBuilder().build(); assertTrue(array.isEmpty()); assertEquals("[]", array.toString()); }