ObservableScalarXMap { public static <T, U> Observable<U> scalarXMap(T value, Function<? super T, ? extends ObservableSource<? extends U>> mapper) { return RxJavaPlugins.onAssembly(new ScalarXMapObservable<T, U>(value, mapper)); } private  ObservableScalarXMap(); @SuppressWarnings("unchecked") static boolean tryScalarXMapSubscribe(ObservableSource<T> source,
            Observer<? super R> observer,
            Function<? super T, ? extends ObservableSource<? extends R>> mapper); static Observable<U> scalarXMap(T value,
            Function<? super T, ? extends ObservableSource<? extends U>> mapper);  }
@Test public void scalarMapToEmpty() { ObservableScalarXMap.scalarXMap(1, new Function<Integer, ObservableSource<Integer>>() { @Override public ObservableSource<Integer> apply(Integer v) throws Exception { return Observable.empty(); } }) .test() .assertResult(); }
@Test public void scalarMapToCrashingCallable() { ObservableScalarXMap.scalarXMap(1, new Function<Integer, ObservableSource<Integer>>() { @Override public ObservableSource<Integer> apply(Integer v) throws Exception { return new CallablePublisher(); } }) .test() .assertFailure(TestException.class); }