code: protected com.vividsolutions.jts.geom.Geometry toJtsGeometryCollection(Geometry<?> src) {
  
          com.vividsolutions.jts.geom.Geometry returnGeometry;
          if (src instanceof Point) {
              returnGeometry = toJtsPoint((Point) src);
          } else if (src instanceof LineString) {
              returnGeometry = toJtsLineString((LineString) src);
          } else if (src instanceof Polygon) {
              returnGeometry = toJtsPolygon((Polygon) src);
          } else if (src instanceof MultiPoint) {
              AbstractJtsCodec<com.vividsolutions.jts.geom.MultiPoint, MultiPoint> codec = new MultiPointCodec(this.geometryFactory);
              returnGeometry = codec.fromGeometry((MultiPoint) src);
          } else if (src instanceof MultiLineString) {
              AbstractJtsCodec<com.vividsolutions.jts.geom.MultiLineString, MultiLineString> codec = new MultiLineStringCodec(this.geometryFactory);
              returnGeometry = codec.fromGeometry((MultiLineString) src);
          } else if (src instanceof MultiPolygon) {
              AbstractJtsCodec<com.vividsolutions.jts.geom.MultiPolygon, MultiPolygon> codec = new MultiPolygonCodec(this.geometryFactory);
              returnGeometry = codec.fromGeometry((MultiPolygon) src);
          } else if (src instanceof GeometryCollection) {
              GeometryCollection geometryCollection = (GeometryCollection) src;
              returnGeometry = this.geometryFactory.createGeometryCollection(StreamSupport.stream(geometryCollection.getGeometries().spliterator(), false)
                      .map(this::toJtsGeometryCollection)
                      .toArray(com.vividsolutions.jts.geom.Geometry[]::new));
          } else {
              throw new IllegalArgumentException("Unsupported geometry type: " + src.type());
          }
          return returnGeometry;
      }
docs: GeometryCollection ---