code: public FeatureCollection toGeoServiceGeometry(final Geometry geometry) {
          if (geometry == null) {
              return GeoServiceGeometry.createFeatureCollection(
                      toLocationFeature(new LatLng(Double.NaN, Double.NaN),
                              LocationType.UNKNOWN),
                      null, null);
          }
          return GeoServiceGeometry.createFeatureCollection(
                  toLocationFeature(geometry.location, geometry.locationType),
                  toBox("bounds", geometry.bounds),
                  toBox("viewport", geometry.viewport));
      }
docs: Create a GeoServiceGeometry from a Geometry.
  
  @param geometry the Geometry
  @return the GeoServiceGeometry