code: public Geometry toGeometry(final FeatureCollection featureCollection) {
          if (featureCollection == null) {
              return null;
          }
          final Geometry geometry = new Geometry();
          final Feature location =
                  populateBoundaries(geometry, featureCollection);
          populateLocation(geometry, location);
          return geometry;
      }
docs: Create a Geometry from a GeoServiceGeometry.
  
  @param featureCollection the feature collection representing the geometry
  @return the Geometry