### Question:
GeoJsonWriter { private void writeMultiPolygon(JSONStringer b, MultiPolygon mp) { b.array(); for (int i = 0; i < mp.getNumGeometries(); i++) { writePolygon(b, (Polygon) mp.getGeometryN(i)); } b.endArray(); }  String write(Geometry geometry);  }### Answer:
@Test public void writeMultiPolygon() { MultiPolygon g = factory.createMultiPolygon(new Polygon[]{ factory.createPolygon(new Coordinate[]{p(0,0),p(0,4),p(4,0),p(0,0)}), factory.createPolygon(new Coordinate[]{p(0,0),p(0,1),p(1,0),p(0,0)}) }); assertEquals("{" + "\"type\":\"Feature\",\"properties\":{}," + "\"geometry\":{\"type\":\"MultiPolygon\"," + "\"coordinates\":[[[[0,0],[4,0],[0,4],[0,0]]],[[[0,0],[1,0],[0,1],[0,0]]]]}" + "}", write(g)); }