@Test
public void testNextWithError() {

    Subject<String, String> obs = PublishSubject.create();
    Iterator<String> it = next(obs).iterator();
    fireOnNextInNewThread(obs, "one");
    assertTrue(it.hasNext());
    assertEquals("one", it.next());
    fireOnErrorInNewThread(obs);
    try {
        it.hasNext();
        fail("Expected an TestException");
    } catch (TestException e) {
    }
    assertErrorAfterObservableFail(it);
}