// create and serialize a FeatureCollection
List<Features> features = new ArrayList<Features>();
Map<String, Object> properties = new HashMap<String, Object>();
features.add(new Feature(geometry, properties);
GeoJSONWriter writer = new GeoJSONWriter();
GeoJSON json = writer.write(features);
Feature should be singular
// create and serialize a FeatureCollection
List<Feature> features = new ArrayList<Feature>();
Map<String, Object> properties = new HashMap<String, Object>();
features.add(new Feature(geometry, properties)); <-- extra parenthesis
GeoJSONWriter writer = new GeoJSONWriter();
GeoJSON json = writer.write(features);
Feature should be singular