code: public static LineString removeCoordinates(LineString g) {
          Coordinate[] coords = CoordinateUtils.removeDuplicatedCoordinates(g.getCoordinates(), false);
          return FACTORY.createLineString(coords);
      }
docs: Removes duplicated coordinates within a LineString.
  
  @param g
  @return