@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();
}