@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();
}