@Test
public void selectorDisconnectsIndependentSource() {

    PublishSubject<Integer> ps = PublishSubject.create();
    ps.publish(new Function<Observable<Integer>, ObservableSource<Integer>>() {
        @Override
        public ObservableSource<Integer> apply(Observable<Integer> v) throws Exception {
            return Observable.range(1, 2);
        }
    })
    .test()
    .assertResult(1, 2);
    assertFalse(ps.hasObservers());
}