@Test public void testJust() { AbstractOnSubscribe<Integer, Void> aos = new AbstractOnSubscribe<Integer, Void>() { @Override protected void next(SubscriptionState<Integer, Void> state) { state.onNext(1); state.onCompleted(); } }; TestSubscriber<Integer> ts = new TestSubscriber<Integer>(); aos.toObservable().subscribe(ts); ts.assertNoErrors(); ts.assertTerminalEvent(); ts.assertReceivedOnNext(Arrays.asList(1)); }
public final Observable<T> toObservable() { return Observable.create(this); }
AbstractOnSubscribe implements OnSubscribe<T> { public final Observable<T> toObservable() { return Observable.create(this); } }
AbstractOnSubscribe implements OnSubscribe<T> { public final Observable<T> toObservable() { return Observable.create(this); }  }
AbstractOnSubscribe implements OnSubscribe<T> { public final Observable<T> toObservable() { return Observable.create(this); }  @Override final void call(final Subscriber<? super T> subscriber); final Observable<T> toObservable(); static AbstractOnSubscribe<T, S> create(Action1<SubscriptionState<T, S>> next); static AbstractOnSubscribe<T, S> create(Action1<SubscriptionState<T, S>> next,
            Func1<? super Subscriber<? super T>, ? extends S> onSubscribe); static AbstractOnSubscribe<T, S> create(Action1<SubscriptionState<T, S>> next,
            Func1<? super Subscriber<? super T>, ? extends S> onSubscribe, Action1<? super S> onTerminated); }
AbstractOnSubscribe implements OnSubscribe<T> { public final Observable<T> toObservable() { return Observable.create(this); }  @Override final void call(final Subscriber<? super T> subscriber); final Observable<T> toObservable(); static AbstractOnSubscribe<T, S> create(Action1<SubscriptionState<T, S>> next); static AbstractOnSubscribe<T, S> create(Action1<SubscriptionState<T, S>> next,
            Func1<? super Subscriber<? super T>, ? extends S> onSubscribe); static AbstractOnSubscribe<T, S> create(Action1<SubscriptionState<T, S>> next,
            Func1<? super Subscriber<? super T>, ? extends S> onSubscribe, Action1<? super S> onTerminated);  }