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