Take elements from a Stream until the predicate holds
<pre>
{@code Streams.takeUntil(Stream.of(4,3,6,7),i->i==6).collect(CyclopsCollectors.toList());
//[4,3]
}
</pre>
@param stream
@param predicate
@return
481584
public static <U> Stream<U> takeUntil(final Stream<U> stream, final Predicate<? super U> predicate) {
        return takeWhile(stream, predicate.negate());

    }
1771
public Optional<T> filter(final Predicate<? super T> predicate) {
        if (isPresent() && predicate.test(get())) {
            return this;
        }

        return empty();
    }
806045
public static <T> Map<T, Long> countBy(Stream<T> stream) {
        return stream.collect(groupingBy(identity(), counting()));
    }
1194719
@Override
    public <R, A> R collect(Collector<? super T, A, R> collector) {
        Predicate<A> finished = finished(collector);
        if (finished != null) {
            BiConsumer<A, ? super T> acc = collector.accumulator();
            BinaryOperator<A> combiner = collector.combiner();
            Spliterator<T> spliterator = spliterator();
            if (!isParallel()) {
                A a = collector.supplier().get();
                if (!finished.test(a)) {
                    try {
                        // forEachRemaining can be much faster
                        // and take much less memory than tryAdvance for certain
                        // spliterators
                        spliterator.forEachRemaining(e -> {
                            acc.accept(a, e);
                            if (finished.test(a))
                                throw new CancelException();
                        });
                    } catch (CancelException ex) {
                        // ignore
                    }
                }
                return collector.finisher().apply(a);
            }
            Spliterator<A> spltr;
            if (!spliterator.hasCharacteristics(Spliterator.ORDERED)
                || collector.characteristics().contains(Characteristics.UNORDERED)) {
                spltr = new UnorderedCancellableSpliterator<>(spliterator, collector.supplier(), acc, combiner,
                        finished);
            } else {
                spltr = new OrderedCancellableSpliterator<>(spliterator, collector.supplier(), acc, combiner, finished);
            }
            return collector.finisher().apply(
                new StreamEx<>(StreamSupport.stream(spltr, true), context).findFirst().get());
        }
        return rawCollect(collector);
    }
999926
@NotNull
    public Stream<T> filterNot(@NotNull final Predicate<? super T> predicate) {
        return filter(Predicate.Util.negate(predicate));
    }
239800
public static <T> Iterator<T> filteringIterator(
        Iterator<? extends T> iterator, 
        Predicate<? super T> predicate)
    {
        Objects.requireNonNull(iterator, "The iterator is null");
        Objects.requireNonNull(predicate, "The predicate is null");
        return new FilteringIterator<T>(iterator, predicate);
    }
1198210
@Override
    public <X> LazyCollectionX<X> fromStream(final ReactiveSeq<X> stream) {
        return ListX.fromIterable(stream.collect(Collectors.toList()));
    }
950391
@Override
    public StreamT<W,T> dropUntil(final Predicate<? super T> p) {

        return (StreamT<W,T>) FoldableTransformerSeq.super.dropUntil(p);
    }
9670
public static final <T> List<List<T>> split(List<T> list, Predicate<T> predicate)
    {
        if (list.isEmpty())
        {
            return Collections.EMPTY_LIST;
        }
        List<List<T>> lists = new ArrayList<>();
        boolean b = predicate.test(list.get(0));
        int len = list.size();
        int start = 0;
        for (int ii=1;ii<len;ii++)
        {
            boolean t = predicate.test(list.get(ii));
            if (b != t)
            {
                lists.add(list.subList(start, ii));
                start = ii;
                b = t;
            }
        }
        lists.add(list.subList(start, len));
        return lists;
    }
495698
public static <U> Stream<U> takeWhile(final Stream<U> stream, final Predicate<? super U> predicate) {
        return StreamSupport.stream(new LimitWhileSpliterator<>(stream.spliterator(), predicate),stream.isParallel());
    }
756385
public static Stream<Path> getChildrenPathStream(Path path,
			Predicate<Path> filter) {
		return getChildrenPathStream(path).filter(filter);
	}
1079307
public Gather<T> filterAsGather(Predicate<T> decision) {
		return from(Collections2.filter(elements.get(), decision));
	}
1122387
@SafeVarargs
    @SuppressWarnings("unchecked")
    public static <T> Stream<T> stream(Iterable<T>... iterables) {
        List<Iterator<T>> iterators = Arrays.stream(iterables)
            .map(Iterable::iterator)
            .collect(Collectors.toList());

        return stream(iterators.toArray(new Iterator[iterables.length]));
    }
937279
public <U> SimpleReactStream<U> from(final Stream<U> stream) {

        final Stream s = stream.map(it -> CompletableFuture.completedFuture(it));
        return construct(s);
    }
504416
public static <E> List<E> filter(final Iterable<E> iterable, final Predicate<E> pred) {
        final List<E> filtered = newArrayList();
        for (E element : iterable) {
            if (pred.test(element)) {
                filtered.add(element);
            }
        }
        return filtered;
    }
692138
public static Predicate parse(final String predicate) {
        return PredicateParser.parse(predicate, Thread.currentThread().getContextClassLoader());
    }
105792
@Override
    public ListT<W,T> filter(final Predicate<? super T> test) {
        return of(run.map(seq -> seq.filter(test)));
    }