@SuppressWarnings("unchecked") @Test public void shouldNotInvokeFuncUntilSubscription() throws Exception { Callable<Object> func = mock(Callable.class); when(func.call()).thenReturn(new Object()); Observable<Object> fromCallableObservable = Observable.fromCallable(func); verifyZeroInteractions(func); fromCallableObservable.subscribe(); verify(func).call(); }
@Override public T call() throws Exception { return ObjectHelper.requireNonNull(callable.call(), "The callable returned a null value"); }
ObservableFromCallable extends Observable<T> implements Callable<T> { @Override public T call() throws Exception { return ObjectHelper.requireNonNull(callable.call(), "The callable returned a null value"); } }
ObservableFromCallable extends Observable<T> implements Callable<T> { @Override public T call() throws Exception { return ObjectHelper.requireNonNull(callable.call(), "The callable returned a null value"); } ObservableFromCallable(Callable<? extends T> callable); }
ObservableFromCallable extends Observable<T> implements Callable<T> { @Override public T call() throws Exception { return ObjectHelper.requireNonNull(callable.call(), "The callable returned a null value"); } ObservableFromCallable(Callable<? extends T> callable); @Override void subscribeActual(Observer<? super T> s); @Override T call(); }
ObservableFromCallable extends Observable<T> implements Callable<T> { @Override public T call() throws Exception { return ObjectHelper.requireNonNull(callable.call(), "The callable returned a null value"); } ObservableFromCallable(Callable<? extends T> callable); @Override void subscribeActual(Observer<? super T> s); @Override T call();  }