@Test public void testTakeWhileDoesntLeakErrors() { Observable<String> source = Observable.create(new Observable.OnSubscribeFunc<String>() { @Override public Subscription onSubscribe(Observer<? super String> observer) { observer.onNext("one"); observer.onError(new Throwable("test failed")); return Subscriptions.empty(); } }); Observable.create(takeWhile(source, new Func1<String, Boolean>() { @Override public Boolean call(String s) { return false; } })).toBlockingObservable().lastOrDefault(""); }
public static <T> OnSubscribeFunc<T> takeWhile(final Observable<? extends T> items, final Func1<? super T, Boolean> predicate) { return takeWhileWithIndex(items, OperationTakeWhile.<T> skipIndex(predicate)); }
OperationTakeWhile { public static <T> OnSubscribeFunc<T> takeWhile(final Observable<? extends T> items, final Func1<? super T, Boolean> predicate) { return takeWhileWithIndex(items, OperationTakeWhile.<T> skipIndex(predicate)); } }
OperationTakeWhile { public static <T> OnSubscribeFunc<T> takeWhile(final Observable<? extends T> items, final Func1<? super T, Boolean> predicate) { return takeWhileWithIndex(items, OperationTakeWhile.<T> skipIndex(predicate)); }  }
OperationTakeWhile { public static <T> OnSubscribeFunc<T> takeWhile(final Observable<? extends T> items, final Func1<? super T, Boolean> predicate) { return takeWhileWithIndex(items, OperationTakeWhile.<T> skipIndex(predicate)); }  static OnSubscribeFunc<T> takeWhile(final Observable<? extends T> items, final Func1<? super T, Boolean> predicate); static OnSubscribeFunc<T> takeWhileWithIndex(final Observable<? extends T> items, final Func2<? super T, ? super Integer, Boolean> predicate); }
OperationTakeWhile { public static <T> OnSubscribeFunc<T> takeWhile(final Observable<? extends T> items, final Func1<? super T, Boolean> predicate) { return takeWhileWithIndex(items, OperationTakeWhile.<T> skipIndex(predicate)); }  static OnSubscribeFunc<T> takeWhile(final Observable<? extends T> items, final Func1<? super T, Boolean> predicate); static OnSubscribeFunc<T> takeWhileWithIndex(final Observable<? extends T> items, final Func2<? super T, ? super Integer, Boolean> predicate);  }