@Test(timeout = 1000)
public void testMultiThreadedWithNPE() throws InterruptedException {

    TestMultiThreadedObservable onSubscribe = new TestMultiThreadedObservable("one", "two", "three", null);
    Flowable<String> w = Flowable.unsafeCreate(onSubscribe);
    BusySubscriber busySubscriber = new BusySubscriber();
    Subscriber<String> aw = serializedSubscriber(busySubscriber);
    w.subscribe(aw);
    onSubscribe.waitToFinish();
    busySubscriber.terminalEvent.await();
    System.out.println("OnSubscribe maxConcurrentThreads: " + onSubscribe.maxConcurrentThreads.get() + "  Subscriber maxConcurrentThreads: " + busySubscriber.maxConcurrentThreads.get());
    // we can't know how many onNext calls will occur since they each run on a separate thread
    // that depends on thread scheduling so 0, 1, 2 and 3 are all valid options
    // assertEquals(3, busySubscriber.onNextCount.get());
    assertTrue(busySubscriber.onNextCount.get() < 4);
    assertTrue(busySubscriber.onError);
    // no onComplete because onError was invoked
    assertFalse(busySubscriber.onComplete);
    // non-deterministic because unsubscribe happens after 'waitToFinish' releases
    // so commenting out for now as this is not a critical thing to test here
    //verify(s, times(1)).unsubscribe();
    // we can have concurrency ...
    assertTrue(onSubscribe.maxConcurrentThreads.get() > 1);
    // ... but the onNext execution should be single threaded
    assertEquals(1, busySubscriber.maxConcurrentThreads.get());
}