JSONArrays { public static List<Object> asList(JSONArray array) throws JSONException { List<Object> list = new ArrayList<Object>(array.length()); for (int i=0, j=array.length(); i<j; i++) list.add(array.get(i)); return list; }  static List<Object> asList(JSONArray array); static JSONArray asJSONArray(List<Object> list); static JSONArray asJSONObjectArray(List<History> list);  }
@Test public void testConvertJSONArrayToList() throws JSONException { JSONArray array = new JSONArray("[ '1', '2', '3' ]"); List<Object> list = JSONArrays.asList(array); assertThat(list, equalTo(Arrays.asList(new Object[] { "1", "2", "3" }))); }