@Test
public void writer() {

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