code: public static MultiLineString removeDuplicateCoordinates(MultiLineString multiLineString, double tolerance) throws SQLException {
          ArrayList<LineString> lines = new ArrayList<LineString>();
          for (int i = 0; i < multiLineString.getNumGeometries(); i++) {
              LineString line = (LineString) multiLineString.getGeometryN(i);
              lines.add(removeDuplicateCoordinates(line, tolerance));
          }
          return FACTORY.createMultiLineString(GeometryFactory.toLineStringArray(lines));
      }
docs: Removes duplicated coordinates in a MultiLineString.
  
  @param multiLineString
  @param tolerance to delete the coordinates
  @return