class GeoJsonPolygonWriter
            implements ObjectWriter {
        public static final GeoJsonPolygonWriter INSTANCE = new GeoJsonPolygonWriter();

        static final String PREFIX = "{\"type\":\"Polygon\",\"coordinates\":";
        static final byte[] utf8Prefix = PREFIX.getBytes(StandardCharsets.US_ASCII);
        static final char[] charsPrefix = PREFIX.toCharArray();

        @Override
        public void write(JSONWriter jsonWriter, Object object, Object fieldName, Type fieldType, long features) {<FILL_FUNCTION_BODY>}
    }

            if (object == null) {
                jsonWriter.writeNull();
                return;
            }

            GeoJsonPolygon polygon = (GeoJsonPolygon) object;
            if (jsonWriter.utf8) {
                jsonWriter.writeRaw(utf8Prefix);
            } else if (jsonWriter.utf16) {
                jsonWriter.writeRaw(charsPrefix);
            } else {
                jsonWriter.startObject();
                jsonWriter.writeName("type");
                jsonWriter.writeColon();
                jsonWriter.writeString("Point");

                jsonWriter.writeName("coordinates");
                jsonWriter.writeColon();
            }

            List<GeoJsonLineString> coordinates = polygon.getCoordinates();
            jsonWriter.startArray();
            for (int i = 0; i < coordinates.size(); i++) {
                if (i != 0) {
                    jsonWriter.writeComma();
                }
                GeoJsonLineString lineString = coordinates.get(i);
                jsonWriter.startArray();
                List<Point> points = lineString.getCoordinates();
                for (int j = 0; j < points.size(); j++) {
                    if (j != 0) {
                        jsonWriter.writeComma();
                    }
                    Point point = points.get(i);
                    jsonWriter.writeDoubleArray(point.getX(), point.getY());
                }
                jsonWriter.endArray();
            }
            jsonWriter.endArray();

            jsonWriter.endObject();
        
<no_super_class>