Group a Stream while the supplied predicate holds

@see ReactiveSeq#groupedWhile(Predicate)

@param stream Stream to group
@param predicate Predicate to determine grouping
@return Stream grouped into Lists determined by predicate
17013
public final static <T> Stream<Seq<T>> groupedWhile(final Stream<T> stream, final Predicate<? super T> predicate) {
        return StreamSupport.stream(new GroupedWhileSpliterator<>(stream.spliterator(),()->Seq.of(),Function.identity(),predicate.negate()),stream.isParallel());

    }
166614
public static <T> Iterable<Indexed<T>> enumerate(Iterable<T> stream) {
        return new Iterable<Indexed<T>>() {

            @Override
            public Iterator<Indexed<T>> iterator() {
                Iterator<T> itr = stream.iterator();
                return new Iterator<Indexed<T>>() {

                    private int i = 0;

                    @Override
                    public boolean hasNext() {
                        return itr.hasNext();
                    }

                    @Override
                    public Indexed<T> next() {
                        Indexed<T> nextPair = new Indexed<T>(itr.next(), i);
                        i++;
                        return nextPair;
                    }
                };
            }
        };
    }
19967
public static <T> CloseableIterator<T> fromStream(Stream<T> stream) {
        return wrap(stream.iterator(), stream);
    }
968713
@Override
    public StreamT<W,T> dropWhile(final Predicate<? super T> p) {

        return (StreamT<W,T>) FoldableTransformerSeq.super.dropWhile(p);
    }
609947
public static String joiningWith(Stream<String> stringStream,
            CharSequence delimiter) {
        return stringStream.collect(Collectors.joining(delimiter));
    }
1121877
public static <T> boolean xMatch(final Stream<T> stream, final int num, final Predicate<? super T> c) {

        return stream.filter(t -> c.test(t))
                     .collect(java.util.stream.Collectors.counting()) == num;
    }
596715
public Gather<T> dropWhile(final Predicate<T> predicate) {
    	final Iterator<T> it = each().iterator();
        return from(new AbstractIterator<T>() {
            private boolean done = false;
            protected T computeNext() {
                if (!done) {
                    while (it.hasNext()) {
                        T t = it.next();
                        if (!predicate.apply(t)) {
                            done = true;
                            return t;
                        }
                    }
                }
                if (it.hasNext()) {
                    return it.next();
                }
                else {
                    return endOfData();
                }
            }
        });
    }
139420
public static <T> Stream<T> of(Iterable<T> iterable) {
    checkNotNull(iterable);
    return new StreamImpl<T>(iterable);
  }
1198210
@Override
    public <X> LazyCollectionX<X> fromStream(final ReactiveSeq<X> stream) {
        return ListX.fromIterable(stream.collect(Collectors.toList()));
    }
4921
@Override
    public StreamT<W,T> takeUntil(final Predicate<? super T> p) {

        return (StreamT<W,T>) FoldableTransformerSeq.super.takeUntil(p);
    }
1134714
public static <T> Map<Boolean, List<T>> toMapPartition( Stream<T> stream, Predicate<T> predicate ) {
        return stream.collect(Collectors.partitioningBy(predicate));
    }
469523
public static <T> List<T> toList(BaseStream<T, ? extends BaseStream> stream) {
        return StreamSupport.stream(
                        Spliterators.spliteratorUnknownSize(stream.iterator(), Spliterator.ORDERED),
                false).collect(Collectors.<T>toList());
    }
983169
@SuppressWarnings("unchecked")
    public static <T> ReactiveSeq<T> takeUntil(final Stream<T> stream, final Predicate<? super T> predicate) {
        final Iterator<T> it = stream.iterator();

        class LimitUntil implements Iterator<T> {
            T next = (T) NULL;
            boolean test = false;

            void test() {
                if (!test && next == NULL && it.hasNext()) {
                    next = it.next();

                    if (test = predicate.test(next)) {
                        next = (T) NULL;
                        close(it); // need to close any open queues
                    }
                }
            }

            @Override
            public boolean hasNext() {
                test();
                return next != NULL;
            }

            @Override
            public T next() {
                if (next == NULL)
                    throw new NoSuchElementException();

                try {
                    return next;
                } finally {
                    next = (T) NULL;
                }
            }
        }

        return ReactiveSeq.fromIterator(new LimitUntil())
                  .onClose(() -> {
                      stream.close();
                  });
    }
680295
public Stream partition(Grouping grouping) {
        if (_node instanceof PartitionNode) {
            return each(new Fields(), new TrueFilter()).partition(grouping);
        } else {
            return _topology.addSourcedNode(this, new PartitionNode(_node.streamId, _name, getOutputFields(), grouping));
        }
    }
314110
public static <U> Stream<U> dropWhile(final Stream<U> stream, final Predicate<? super U> predicate) {
        return StreamSupport.stream(new SkipWhileSpliterator<U>(stream.spliterator(),predicate), stream.isParallel());
    }
1097179
public <R> Stream<R> map(Function<? super T, ? extends R> mapper) {
        List<R> list = new ArrayList<R>();
        while (iterator.hasNext()) {
            list.add(mapper.apply(iterator.next()));
        }
        return Stream.of(list);
    }
736856
public static <T> Stream<T> intersperse(final Stream<T> stream, final T value) {
        return stream.flatMap(t -> Stream.of(value, t))
                     .skip(1);
    }