code: public static Geometry rotate(Geometry geom, double theta) {
          if (geom != null) {
              Coordinate center = geom.getEnvelopeInternal().centre();
              return rotate(geom, theta, center.x, center.y);
          } else {
              return null;
          }
      }
docs: Rotates a geometry by a given angle (in radians) about the center
  of the geometry's envelope.
  
  @param geom  Geometry
  @param theta Angle
  @return The geometry rotated about the center of its envelope