code: public static Geometry reverse3DLine(Geometry geometry, String order) {
          if(geometry == null){
              return null;
          }
          if (geometry instanceof LineString) {
              return reverse3D((LineString) geometry, order);
          } else if (geometry instanceof MultiLineString) {
              return reverse3D((MultiLineString) geometry, order);
          }
          return null;
      }
docs: Returns a 1 dimension geometry with vertex order reversed according values
  ascending (asc) or descending (desc)
  
  
  @param geometry
  @param order
  @return