### Question:
GeoJSONWriter extends JSONEncoder { public GeoJSONWriter point(Point p) throws IOException { if (p == null) { return (GeoJSONWriter) nul(); } object() .key("type").value("Point") .key("coordinates").array() .value(p.getX()) .value(p.getY()); if (!Double.isNaN(p.getCoordinate().z)) { value(p.getCoordinate().z); } endArray().endObject(); return this; } 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 testSingleObject() throws IOException { w.point(Geom.point(1, 2)); JSONObject obj = (JSONObject) JSONValue.parse(string()); assertEquals("Point", obj.get("type")); }