code: public static Bbox getBounds(Geometry geometry) {
  		if (geometry == null) {
  			throw new IllegalArgumentException("Cannot get bounds for null geometry.");
  		}
  		if (isEmpty(geometry)) {
  			return null;
  		}
  		Bbox bbox = null;
  		if (geometry.getGeometries() != null) {
  			bbox = getBounds(geometry.getGeometries()[0]);
  			for (int i = 1; i < geometry.getGeometries().length; i++) {
  				bbox = BboxService.union(bbox, getBounds(geometry.getGeometries()[i]));
  			}
  		}
  		if (geometry.getCoordinates() != null) {
  			double minX = Double.MAX_VALUE;
  			double minY = Double.MAX_VALUE;
  			double maxX = -Double.MAX_VALUE;
  			double maxY = -Double.MAX_VALUE;
  
  			for (Coordinate coordinate : geometry.getCoordinates()) {
  				if (coordinate.getX() < minX) {
  					minX = coordinate.getX();
  				}
  				if (coordinate.getY() < minY) {
  					minY = coordinate.getY();
  				}
  				if (coordinate.getX() > maxX) {
  					maxX = coordinate.getX();
  				}
  				if (coordinate.getY() > maxY) {
  					maxY = coordinate.getY();
  				}
  			}
  			if (bbox == null) {
  				bbox = new Bbox(minX, minY, maxX - minX, maxY - minY);
  			} else {
  				bbox = BboxService.union(bbox, new Bbox(minX, minY, maxX - minX, maxY - minY));
  			}
  		}
  		return bbox;
  	}
docs: Get the closest {@link Bbox} around the geometry.
  
  @param geometry The geometry to calculate a bounding box for.
  @return The bounding box for the given geometry.