@Test public void testDefaultIfEmptyWithEmpty() { Observable<Integer> source = Observable.empty(); Observable<Integer> observable = Observable.create(defaultIfEmpty( source, 10)); @SuppressWarnings("unchecked") Observer<Integer> observer = mock(Observer.class); observable.subscribe(observer); verify(observer, times(1)).onNext(10); verify(observer, never()).onError( org.mockito.Matchers.any(Throwable.class)); verify(observer, times(1)).onCompleted(); }
public static <T> OnSubscribeFunc<T> defaultIfEmpty( Observable<? extends T> source, T defaultValue) { return new DefaultIfEmpty<T>(source, defaultValue); }
OperationDefaultIfEmpty { public static <T> OnSubscribeFunc<T> defaultIfEmpty( Observable<? extends T> source, T defaultValue) { return new DefaultIfEmpty<T>(source, defaultValue); } }
OperationDefaultIfEmpty { public static <T> OnSubscribeFunc<T> defaultIfEmpty( Observable<? extends T> source, T defaultValue) { return new DefaultIfEmpty<T>(source, defaultValue); }  }
OperationDefaultIfEmpty { public static <T> OnSubscribeFunc<T> defaultIfEmpty( Observable<? extends T> source, T defaultValue) { return new DefaultIfEmpty<T>(source, defaultValue); }  static OnSubscribeFunc<T> defaultIfEmpty(
            Observable<? extends T> source, T defaultValue); }
OperationDefaultIfEmpty { public static <T> OnSubscribeFunc<T> defaultIfEmpty( Observable<? extends T> source, T defaultValue) { return new DefaultIfEmpty<T>(source, defaultValue); }  static OnSubscribeFunc<T> defaultIfEmpty(
            Observable<? extends T> source, T defaultValue);  }