code: public static Geometry computeMinimumRectangle(Geometry geometry){
          if(geometry == null){
              return null;
          }
          return new MinimumDiameter(geometry).getMinimumRectangle();
      }
docs: Gets the minimum rectangular {@link Polygon} which encloses the input geometry.
  @param geometry Input geometry
  @return