code: public static Geometry reverse(Geometry geometry) {
          if (geometry == null) {
              return null;
          }
          if (geometry instanceof MultiPoint) {
              return reverseMultiPoint((MultiPoint) geometry);
          }
          return geometry.reverse();
      }
docs: Returns the geometry with vertex order reversed.
  
  @param geometry Geometry
  @return geometry with vertex order reversed