@Test public void testOnErrorInNewThread() { Subject<String, String> obs = PublishSubject.create(); Iterator<String> it = next(obs).iterator(); fireOnErrorInNewThread(obs); try { it.hasNext(); fail("Expected an TestException"); } catch (TestException e) { } assertErrorAfterObservableFail(it); }
public static <T> Iterable<T> next(final Observable<? extends T> items) { return new Iterable<T>() { @Override public Iterator<T> iterator() { NextObserver<T> nextObserver = new NextObserver<T>(); final NextIterator<T> nextIterator = new NextIterator<T>(nextObserver); items.materialize().subscribe(nextObserver); return nextIterator; } }; }
OperationNext { public static <T> Iterable<T> next(final Observable<? extends T> items) { return new Iterable<T>() { @Override public Iterator<T> iterator() { NextObserver<T> nextObserver = new NextObserver<T>(); final NextIterator<T> nextIterator = new NextIterator<T>(nextObserver); items.materialize().subscribe(nextObserver); return nextIterator; } }; } }
OperationNext { public static <T> Iterable<T> next(final Observable<? extends T> items) { return new Iterable<T>() { @Override public Iterator<T> iterator() { NextObserver<T> nextObserver = new NextObserver<T>(); final NextIterator<T> nextIterator = new NextIterator<T>(nextObserver); items.materialize().subscribe(nextObserver); return nextIterator; } }; }  }
OperationNext { public static <T> Iterable<T> next(final Observable<? extends T> items) { return new Iterable<T>() { @Override public Iterator<T> iterator() { NextObserver<T> nextObserver = new NextObserver<T>(); final NextIterator<T> nextIterator = new NextIterator<T>(nextObserver); items.materialize().subscribe(nextObserver); return nextIterator; } }; }  static Iterable<T> next(final Observable<? extends T> items); }
OperationNext { public static <T> Iterable<T> next(final Observable<? extends T> items) { return new Iterable<T>() { @Override public Iterator<T> iterator() { NextObserver<T> nextObserver = new NextObserver<T>(); final NextIterator<T> nextIterator = new NextIterator<T>(nextObserver); items.materialize().subscribe(nextObserver); return nextIterator; } }; }  static Iterable<T> next(final Observable<? extends T> items);  }