### Question:
GeoJsonWriter { private void writePolygon(JSONStringer b, Polygon p) { b.array(); writeCoordinates(b, p.getExteriorRing().getCoordinates()); for (int i = 0; i < p.getNumInteriorRing(); i++) { writeCoordinates(b, p.getInteriorRingN(i).getCoordinates()); } b.endArray(); }  String write(Geometry geometry);  }### Answer:
@Test public void writePolygon() { Polygon g = factory.createPolygon( factory.createLinearRing(new Coordinate[]{p(0,0), p(0,4), p(4,0), p(0,0)}), new LinearRing[]{factory.createLinearRing(new Coordinate[] {p(1,1), p(2,1), p(1,2), p(1,1)})} ); assertEquals("{" + "\"type\":\"Feature\",\"properties\":{}," + "\"geometry\":{\"type\":\"Polygon\"," + "\"coordinates\":[[[0,0],[4,0],[0,4],[0,0]],[[1,1],[1,2],[2,1],[1,1]]]}" + "}", write(g)); }