Netflix/RxJava — pull request #433 by zsxwing (2013-10-15 06:32:14+00:00)
Title: Fixed testOnErrorViaHasNext in issue #383

Hi,

This PR fixed the issue that `testOnErrorViaHasNext` fails sometimes. It only tries to avoid the failure of unit tests.
However, there is still an issue in the `next` operator. The `hasNext` may return true, but the later `next` throws `IllegalStateException("Observable is completed")`. An example unit test throws `IllegalStateException`:

```java
@Test
public void test() {
Subject obs = PublishSubject.create();
Iterator it = next(obs).iterator();
assertTrue(it.hasNext());
obs.onCompleted();
it.next();
}
```

I think @abersnaze is right.
> hasNext should block until either the onNext or onComplete has been called.