### Question:
GeoJSONWriter extends JSONEncoder { public GeoJSONWriter feature(Feature f) throws IOException { if (f == null) { nul(); return this; } object() .key("type").value("Feature"); if (f.id() != null) { key("id").value(f.id()); } Geometry g = f.geometry(); if (g != null) { key("geometry").geometry(g); } key("properties").object(); for (Map.Entry<String, Object> p : f.map().entrySet()) { String key = p.getKey(); Object o = p.getValue(); if (o instanceof Geometry) { if (o == g) { continue; } key(key).geometry((Geometry)o); } else { key(key).value(o); } } endObject(); 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 testFeature() throws Exception { Map<String,Object> map = new HashMap<>(); map.put("geom", Geom.point(0, 0)); map.put("name", "zero"); w.feature(new MapFeature(map)); JSONObject obj = (JSONObject) JSONValue.parse(string()); assertEquals("Feature", obj.get("type")); assertNotNull(obj.get("geometry")); assertNotNull(obj.get("properties")); }