code: public static GeoJSONObject parse(JSONObject json) {
          String type = JSONUtils.optString(json, GeoJSONObject.JSON_TYPE);
  
          if (TYPE_POINT.equalsIgnoreCase(type)) {
              return new Point(json);
          }
  
          if (TYPE_MULTI_POINT.equalsIgnoreCase(type)) {
              return new MultiPoint(json);
          }
  
          if (TYPE_LINE_STRING.equalsIgnoreCase(type)) {
              return new LineString(json);
          }
  
          if (TYPE_MULTI_LINE_STRING.equalsIgnoreCase(type)) {
              return new MultiLineString(json);
          }
  
          if (TYPE_POLYGON.equalsIgnoreCase(type)) {
              return new Polygon(json);
          }
  
          if (TYPE_MULTI_POLYGON.equalsIgnoreCase(type)) {
              return new MultiPolygon(json);
          }
  
          if (TYPE_GEOMETRY_COLLECTION.equalsIgnoreCase(type)) {
              return new GeometryCollection(json);
          }
  
          if (TYPE_FEATURE.equalsIgnoreCase(type)) {
              return new Feature(json);
          }
  
          if (TYPE_FEATURE_COLLECTION.equalsIgnoreCase(type)) {
              return new FeatureCollection(json);
          }
  
          throw new IllegalArgumentException("The type '" + type + "' is not a valid GeoJSON type.");
      }
docs: Parses the given JSONObject as GeoJSON and returns a concrete subclass of
  {@link GeoJSONObject} corresponding to the type of the root object.
  <p>
  Example:
  <pre>
  {
  "type": "Feature",
  "geometry": {
  "type": "Point",
  "coordinates": [125.6, 10.1]
  },
  }
  </pre>
  <p>
  The above GeoJSON would return an instance of {@link Feature}.
  
  @param json
  A {@link JSONObject} to parse as GeoJSON
  
  @return A concrete subclass instance of {@link GeoJSONObject}.
  
  @throws IllegalArgumentException
  If the given object is not a valid GeoJSON type.