code: private static LineString getClockWise(final LineString lineString) {
          final Coordinate c0 = lineString.getCoordinateN(0);
          final Coordinate c1 = lineString.getCoordinateN(1);
          final Coordinate c2 = lineString.getCoordinateN(2);
          lineString.apply(new UpdateZCoordinateSequenceFilter(0, 3));
          if (CGAlgorithms.computeOrientation(c0, c1, c2) == CGAlgorithms.CLOCKWISE) {
              return lineString;
          } else {            
              return (LineString) lineString.reverse();
          }
      }
docs: Reverse the LineString to be oriented clockwise.
  All NaN z values are replaced by a zero value.
  @param lineString
  @return