@Test
@SuppressWarnings("unchecked")
public void testError() {

    Throwable error = new Throwable();
    Observable<String> obs = Observable.error(error);
    Observer<Boolean> observer = mock(Observer.class);
    Observable.create(all(obs, new Func1<String, Boolean>() {
        @Override
        public Boolean call(String s) {
            return s.length() == 3;
        }
    })).subscribe(observer);
    verify(observer).onError(error);
    verifyNoMoreInteractions(observer);
}