RxEither { public static <L, R> Observable<R> filterRight(Observable<Either<L, R>> either) { return either.filter(RxEither.<L, R>isRight()).map(JoinRight.<L, R>instance()); } private  RxEither(); static Observable<Either<L, R>> left(Observable<L> left); static Observable<Either<L, R>> right(Observable<R> right); static Observable<Either<L, R>> from(Observable<L> left, Observable<R> right); static Func1<Either<L, R>, Boolean> isLeft(); static Func1<Either<L, R>, Boolean> isRight(); static Observable<L> filterLeft(Observable<Either<L, R>> either); static Observable<R> filterRight(Observable<Either<L, R>> either); @Deprecated static Action1<Either<L, R>> foldLazy(Action1<L> left, Action1<R> right); @Deprecated static Func1<Either<L, R>, T> foldLazy(Func1<L, T> left, Func1<R, T> right); static Action1<Either<L, R>> continuedLazy(Action1<L> left, Action1<R> right); static Func1<Either<L, R>, T> joinLazy(Func1<L, T> left, Func1<R, T> right);  }
@Test public void filterRight() { TestSubscriber<EventB> subscriber = new TestSubscriber<>(); Observable<EventB> right = RxEither.filterRight(RxEither.from(eventASubject, eventBSubject)); right.subscribe(subscriber); eventASubject.onNext(eventA); eventBSubject.onNext(eventB); testScheduler.triggerActions(); subscriber.assertNoErrors(); subscriber.assertNotCompleted(); subscriber.assertValue(eventB); }