### Question:
GeoJSONWriter extends JSONEncoder { @Override public GeoJSONWriter array() throws IOException { return (GeoJSONWriter) super.array(); } GeoJSONWriter(Writer out);  GeoJSONWriter(Writer out, int indentSize); static String toString(Geometry g); static String toString(Feature f); static String toString(Cursor<Feature> features); GeoJSONWriter bbox(Envelope b); GeoJSONWriter crs(CoordinateReferenceSystem crs); GeoJSONWriter geometry(Geometry g); GeoJSONWriter point(Point p); GeoJSONWriter lineString(LineString l); GeoJSONWriter polygon(Polygon p); GeoJSONWriter multiPoint(MultiPoint mp); GeoJSONWriter multiLineString(MultiLineString ml); GeoJSONWriter multiPolygon(MultiPolygon mp); GeoJSONWriter geometryCollection(GeometryCollection gc); GeoJSONWriter feature(Feature f); GeoJSONWriter featureCollection(Cursor<Feature> features); GeoJSONWriter featureCollection(); GeoJSONWriter endFeatureCollection(); @Override GeoJSONWriter object(); @Override GeoJSONWriter array(); @Override GeoJSONWriter key(String key); @Override GeoJSONWriter value(Number value); @Override GeoJSONWriter value(double value); @Override GeoJSONWriter value(long value); @Override GeoJSONWriter value(Object value); @Override GeoJSONWriter nul(); @Override GeoJSONWriter value(String value); @Override GeoJSONWriter endObject(); @Override GeoJSONWriter endArray(); @Override GeoJSONWriter flush();  }### Answer:
@Test public void testArray() throws Exception { w.object(); w.key("foo").array() .point(Geom.point(1, 2)).point(Geom.point(3, 4)) .endArray(); w.endObject(); JSONObject obj = (JSONObject) JSONValue.parse(string()); assertTrue(obj.get("foo") instanceof JSONArray); }