MultiPoint implements CoordinateContainer<List<Point>> { @Override public String toJson() { GsonBuilder gson = new GsonBuilder(); gson.registerTypeAdapterFactory(GeoJsonAdapterFactory.create()); return gson.create().toJson(this); } MultiPoint(String type, @Nullable BoundingBox bbox, List<Point> coordinates); static MultiPoint fromJson(@NonNull String json); static MultiPoint fromLngLats(@NonNull List<Point> points); static MultiPoint fromLngLats(@NonNull List<Point> points, @Nullable BoundingBox bbox); @NonNull @Override String type(); @Nullable @Override BoundingBox bbox(); @NonNull @Override List<Point> coordinates(); @Override String toJson(); static TypeAdapter<MultiPoint> typeAdapter(Gson gson); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode();  }
@Test public void toJson() throws IOException { final String json = "{ \"type\": \"MultiPoint\"," + "\"coordinates\": [ [100, 0], [101, 1] ] } "; MultiPoint geo = MultiPoint.fromJson(json); compareJson(json, geo.toJson()); }