code: private static List<SegmentString> fixSegments(List<SegmentString> segments) {
      MCIndexNoder mCIndexNoder = new MCIndexNoder();
      RobustLineIntersector robustLineIntersector = new RobustLineIntersector();
      mCIndexNoder.setSegmentIntersector(new IntersectionAdder(robustLineIntersector));
      mCIndexNoder.computeNodes(segments);
      Collection nodedSubstring = mCIndexNoder.getNodedSubstrings();
      ArrayList<SegmentString> ret = new ArrayList<>(nodedSubstring.size());
      for (Object aNodedSubstring : nodedSubstring) {
        ret.add((SegmentString) aNodedSubstring);
      }
      return ret;
    }
docs: Split originalSegments that intersects. Run this method after calling the last addSegment before calling getIsoVist