@Test
    public void testJSONWriterNestedArrays() throws IOException {
        OutputStream out = new ByteArrayOutputStream();
        JSONWriter w = new JSONWriter(out);
        w.beginArray();

        w.beginArrayValue().beginArray();
        w.endArray().endArrayValue();

        w.beginArrayValue().beginArray();
        w.beginArrayValue().value("hello").endArrayValue();
        w.beginArrayValue().value("world").endArrayValue();
        w.endArray().endArrayValue();

        w.beginArrayValue().beginArray();
        w.endArray().endArrayValue();

        w.beginArrayValue().beginArray();
        w.beginArrayValue().beginArray();
        w.endArray().endArrayValue();
        w.endArray().endArrayValue();

        w.beginArrayValue().beginArray();
        w.endArray().endArrayValue();

        w.endArray();

        assertEquals("[[],[\"hello\",\"world\"],[],[[]],[]]",out.toString());
    }
Tests the JSON writer

@author bratseth
vespajlib/src/test/java/com/yahoo/text/JSONWriterTestCase.java