Returns multiple streams by splitting incoming stream.
@param splitFns The Split Functions that test if the tuple should be emitted into each stream
Note that there could be 0 or multiple target stream ids
196267
@Override
  public Streamlet<R> split(Map<String, SerializablePredicate<R>> splitFns) {
    // Make sure map and stream ids are not empty
    require(splitFns.size() > 0, "At least one entry is required");
    require(splitFns.keySet().stream().allMatch(stream -> StringUtils.isNotBlank(stream)),
            "Stream Id can not be blank");

    SplitStreamlet<R> splitStreamlet = new SplitStreamlet<R>(this, splitFns);
    addChild(splitStreamlet);
    return splitStreamlet;
  }
1357442
public List<Tuple> collectTuples(@NonNull HString hString) {
      return streamTuples(hString).collect(Collectors.toList());
   }
456201
public <T extends Comparable<T>> Stream<TrieNode> max(Function<TrieNode, T> fn, int maxResults) {
    return max(fn, maxResults, root());
  }
1003022
private static <T> Stream<T> enumerationAsStream(Enumeration<? extends T> e)
    {
        Iterator<T> iterator = new Iterator<T>()
        {
            @Override
            public T next()
            {
                return e.nextElement();
            }

            @Override
            public boolean hasNext()
            {
                return e.hasMoreElements();
            }
        };
        return StreamSupport.stream(
            Spliterators.spliteratorUnknownSize(
                iterator, Spliterator.ORDERED), false);
    }
725896
public static String[] splitContentValues(String[] strings) {
        final Set<String> result = new LinkedHashSet<String>();

        for (String string : strings) {
            if (string.isEmpty())
                continue;
            String[] splitted = string.trim().split(",");
            for (String string2 : splitted) {
                result.add(string2);
            }
        }
        return result.toArray(new String[result.size()]);
    }
357091
private IntIterator getCommonSplitDimensions(N node) {
    Collection<SplitHistory> splitHistories = new ArrayList<>(node.getNumEntries());
    for(int i = 0; i < node.getNumEntries(); i++) {
      SpatialEntry entry = node.getEntry(i);
      if(!(entry instanceof XTreeDirectoryEntry)) {
        throw new RuntimeException("Wrong entry type to derive split dimension from: " + entry.getClass().getName());
      }
      splitHistories.add(((XTreeDirectoryEntry) entry).getSplitHistory());
    }
    return SplitHistory.getCommonDimensions(splitHistories);
  }
902117
public List<Double> getSplits() {
        List<Double> splits = new ArrayList<Double>();
        for (Node curNode : getVisibleChildren()) {
            splits.add(nodeSplits.get(curNode));
        }
        return splits;
    }
1350837
@Override
    public Stream<Chunk<byte[], BytesReference>> chunks() {
        Iterator<Chunk<byte[], BytesReference>> iterator = new Iterator<Chunk<byte[], BytesReference>>() {
            Chunk<byte[], BytesReference> nextData = null;

            @Override
            public boolean hasNext() {
                if (nextData != null) {
                    return true;
                } else {
                    try {
                        nextData = readChunk();
                        return nextData != null;
                    } catch (IOException e) {
                        throw new UncheckedIOException(e);
                    }
                }
            }

            @Override
            public Chunk<byte[], BytesReference> next() {
                if (nextData != null || hasNext()) {
                    Chunk<byte[], BytesReference> data = nextData;
                    nextData = null;
                    return data;
                } else {
                    throw new NoSuchElementException();
                }
            }
        };
        return StreamSupport.stream(Spliterators.spliteratorUnknownSize(iterator,
                Spliterator.ORDERED | Spliterator.NONNULL), false);
    }
1199809
public static Stream<CharSequence> split(CharSequence seq, RegexMatcher matcher)
    {
        return StreamSupport.stream(new SpliteratorImpl(seq, matcher), false);
    }
747261
@Override
  public List<? extends BoundedSource<T>> split(long desiredBundleSizeBytes,
      PipelineOptions options) throws Exception {

    List<? extends BoundedSource<T>> splits = delegate.split(desiredBundleSizeBytes, options);
    Collections.shuffle(splits);
    return splits;
  }
1177195
public static MultiPoint of(Stream<Point> points) {
        return of(points.collect(Collectors.toList()));
    }
1135222
public static <T> StreamEx<T> of(Spliterator<? extends T> spliterator) {
        return new StreamEx<>(spliterator, StreamContext.SEQUENTIAL);
    }
755912
public static void getAllSplits(final Set<String> splits, final File path, final String trainingSuffix, final String testSuffix) {
        if (path == null) {
            return;
        }
        File[] files = path.listFiles();
        if (files == null) {
            return;
        }
        for (File file : files) {
            if (file.isDirectory()) {
                getAllSplits(splits, file, trainingSuffix, testSuffix);
            } else if (file.getName().endsWith(trainingSuffix)) {
                splits.add(file.getAbsolutePath().replaceAll(trainingSuffix + "$", ""));
            } else if (file.getName().endsWith(testSuffix)) {
                splits.add(file.getAbsolutePath().replaceAll(testSuffix + "$", ""));
            }
        }
    }
161578
public List<String> splitWithDefaultSplitStrategy(String input) {
        if (input == null) {
            throw new NullPointerException(makeNullArgumentErrorMsg("input"));
        }
        return defaultSplitStrategy().split(input, IGNORED);
    }
1320514
public static List<String> splitLines(String S) {
		List<String> V=new ArrayList<>();
		int start=0;
		int pos;
		while((pos=S.indexOf('\n', start))!=-1) {
			String line;
			if(pos>start && S.charAt(pos-1)=='\r') line = S.substring(start, pos-1);
			else line = S.substring(start, pos);
			V.add(line);
			start=pos+1;
		}
		int slen = S.length();
		if(start<slen) {
			// Ignore any trailing '\r'
			if(S.charAt(slen-1)=='\r') slen--;
			String line = S.substring(start, slen);
			V.add(line);
		}
		return V;
	}
231945
public final static <T> Tuple2<Stream<T>, Stream<T>> partition(final Stream<T> stream, final Predicate<? super T> splitter) {
        final Tuple2<Stream<T>, Stream<T>> Tuple2 = duplicate(stream);
        return Tuple.tuple(
                          Tuple2._1().filter(splitter), Tuple2._2().filter(splitter.negate()));
    }
1075858
public static <T> Stream<T> streamC(T root, Function<? super T, ? extends Collection<T>> edges)
    {
        return StreamSupport.stream(spliterator(root, (y)->edges.apply(y).stream()), false);
    }