Unlike 1.x, this template in 2.x is not fined and is almost similar to how standard operators are implemented. Depending on your needs, you can use instead ObservableTransformer:
ObservableTransformer<String, String> t =
upstream -> upstream.filter(s -> s.length() > 0);
Observable.fromArray("a", "b", "", "d", "", "f")
.compose(t)
.subscribe(System.out::println, Throwable::printStackTrace);
source
share