@Test
public void writerIndent() {

    String str = "[1,2,3]";
    JSONArray array = new JSONArray(str);
    StringWriter sw = new StringWriter();
    array.write(sw, 3, 3);
    assertEquals("[\n" +
            "  1,\n" +
            "  2,\n" +
            "  3\n" +
            "]", sw.toString());
}