ParallelFlowable { @CheckReturnValue public final ParallelFlowable<T> filter(@NonNull Predicate<? super T> predicate) { ObjectHelper.requireNonNull(predicate, "predicate"); return RxJavaPlugins.onAssembly(new ParallelFilter<T>(this, predicate)); }  abstract void subscribe(@NonNull Subscriber<? super T>[] subscribers); abstract int parallelism(); @CheckReturnValue static ParallelFlowable<T> from(@NonNull Publisher<? extends T> source); @CheckReturnValue static ParallelFlowable<T> from(@NonNull Publisher<? extends T> source, int parallelism); @CheckReturnValue @NonNull static ParallelFlowable<T> from(@NonNull Publisher<? extends T> source,
            int parallelism, int prefetch); @Experimental @CheckReturnValue @NonNull final R as(@NonNull ParallelFlowableConverter<T, R> converter); @CheckReturnValue @NonNull final ParallelFlowable<R> map(@NonNull Function<? super T, ? extends R> mapper); @CheckReturnValue @Experimental @NonNull final ParallelFlowable<R> map(@NonNull Function<? super T, ? extends R> mapper, @NonNull ParallelFailureHandling errorHandler); @CheckReturnValue @Experimental @NonNull final ParallelFlowable<R> map(@NonNull Function<? super T, ? extends R> mapper, @NonNull BiFunction<? super Long, ? super Throwable, ParallelFailureHandling> errorHandler); @CheckReturnValue final ParallelFlowable<T> filter(@NonNull Predicate<? super T> predicate); @CheckReturnValue @Experimental final ParallelFlowable<T> filter(@NonNull Predicate<? super T> predicate, @NonNull ParallelFailureHandling errorHandler); @CheckReturnValue @Experimental final ParallelFlowable<T> filter(@NonNull Predicate<? super T> predicate, @NonNull BiFunction<? super Long, ? super Throwable, ParallelFailureHandling> errorHandler); @CheckReturnValue @NonNull final ParallelFlowable<T> runOn(@NonNull Scheduler scheduler); @CheckReturnValue @NonNull final ParallelFlowable<T> runOn(@NonNull Scheduler scheduler, int prefetch); @CheckReturnValue @NonNull final Flowable<T> reduce(@NonNull BiFunction<T, T, T> reducer); @CheckReturnValue @NonNull final ParallelFlowable<R> reduce(@NonNull Callable<R> initialSupplier, @NonNull BiFunction<R, ? super T, R> reducer); @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @CheckReturnValue final Flowable<T> sequential(); @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @CheckReturnValue @NonNull final Flowable<T> sequential(int prefetch); @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @CheckReturnValue @Experimental @NonNull final Flowable<T> sequentialDelayError(); @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @CheckReturnValue @NonNull final Flowable<T> sequentialDelayError(int prefetch); @CheckReturnValue @NonNull final Flowable<T> sorted(@NonNull Comparator<? super T> comparator); @CheckReturnValue @NonNull final Flowable<T> sorted(@NonNull Comparator<? super T> comparator, int capacityHint); @CheckReturnValue @NonNull final Flowable<List<T>> toSortedList(@NonNull Comparator<? super T> comparator); @CheckReturnValue @NonNull final Flowable<List<T>> toSortedList(@NonNull Comparator<? super T> comparator, int capacityHint); @CheckReturnValue @NonNull final ParallelFlowable<T> doOnNext(@NonNull Consumer<? super T> onNext); @CheckReturnValue @Experimental @NonNull final ParallelFlowable<T> doOnNext(@NonNull Consumer<? super T> onNext, @NonNull ParallelFailureHandling errorHandler); @CheckReturnValue @Experimental @NonNull final ParallelFlowable<T> doOnNext(@NonNull Consumer<? super T> onNext, @NonNull BiFunction<? super Long, ? super Throwable, ParallelFailureHandling> errorHandler); @CheckReturnValue @NonNull final ParallelFlowable<T> doAfterNext(@NonNull Consumer<? super T> onAfterNext); @CheckReturnValue @NonNull final ParallelFlowable<T> doOnError(@NonNull Consumer<Throwable> onError); @CheckReturnValue @NonNull final ParallelFlowable<T> doOnComplete(@NonNull Action onComplete); @CheckReturnValue @NonNull final ParallelFlowable<T> doAfterTerminated(@NonNull Action onAfterTerminate); @CheckReturnValue @NonNull final ParallelFlowable<T> doOnSubscribe(@NonNull Consumer<? super Subscription> onSubscribe); @CheckReturnValue @NonNull final ParallelFlowable<T> doOnRequest(@NonNull LongConsumer onRequest); @CheckReturnValue @NonNull final ParallelFlowable<T> doOnCancel(@NonNull Action onCancel); @CheckReturnValue @NonNull final ParallelFlowable<C> collect(@NonNull Callable<? extends C> collectionSupplier, @NonNull BiConsumer<? super C, ? super T> collector); @CheckReturnValue @NonNull static ParallelFlowable<T> fromArray(@NonNull Publisher<T>... publishers); @CheckReturnValue @NonNull final U to(@NonNull Function<? super ParallelFlowable<T>, U> converter); @CheckReturnValue @NonNull final ParallelFlowable<U> compose(@NonNull ParallelTransformer<T, U> composer); @CheckReturnValue @NonNull final ParallelFlowable<R> flatMap(@NonNull Function<? super T, ? extends Publisher<? extends R>> mapper); @CheckReturnValue @NonNull final ParallelFlowable<R> flatMap(
            @NonNull Function<? super T, ? extends Publisher<? extends R>> mapper, boolean delayError); @CheckReturnValue @NonNull final ParallelFlowable<R> flatMap(
            @NonNull Function<? super T, ? extends Publisher<? extends R>> mapper, boolean delayError, int maxConcurrency); @CheckReturnValue @NonNull final ParallelFlowable<R> flatMap(
            @NonNull Function<? super T, ? extends Publisher<? extends R>> mapper,
            boolean delayError, int maxConcurrency, int prefetch); @CheckReturnValue @NonNull final ParallelFlowable<R> concatMap(
            @NonNull Function<? super T, ? extends Publisher<? extends R>> mapper); @CheckReturnValue @NonNull final ParallelFlowable<R> concatMap(
            @NonNull Function<? super T, ? extends Publisher<? extends R>> mapper,
                    int prefetch); @CheckReturnValue @NonNull final ParallelFlowable<R> concatMapDelayError(
            @NonNull Function<? super T, ? extends Publisher<? extends R>> mapper,
                    boolean tillTheEnd); @CheckReturnValue @NonNull final ParallelFlowable<R> concatMapDelayError(
            @NonNull Function<? super T, ? extends Publisher<? extends R>> mapper,
                    int prefetch, boolean tillTheEnd);  }
@Test public void filter() { Flowable.range(1, 20) .parallel() .runOn(Schedulers.computation()) .filter(new Predicate<Integer>() { @Override public boolean test(Integer v) throws Exception { return v % 2 == 0; } }) .sequential() .test() .awaitDone(5, TimeUnit.SECONDS) .assertValueSet(Arrays.asList(2, 4, 6, 8, 10, 12, 14, 16, 18, 20)) .assertNoErrors() .assertComplete(); }