@Test
public void onSubscribeThrows() {

    final List<Object> received = new ArrayList<Object>();
    LambdaSubscriber<Object> o = new LambdaSubscriber<Object>(new Consumer<Object>() {
        @Override
        public void accept(Object v) throws Exception {
            received.add(v);
        }
    },
    new Consumer<Throwable>() {
        @Override
        public void accept(Throwable e) throws Exception {
            received.add(e);
        }
    }, new Action() {
        @Override
        public void run() throws Exception {
            received.add(100);
        }
    }, new Consumer<Subscription>() {
        @Override
        public void accept(Subscription s) throws Exception {
            throw new TestException();
        }
    });
    assertFalse(o.isDisposed());
    Flowable.just(1).subscribe(o);
    assertTrue(received.toString(), received.get(0) instanceof TestException);
    assertEquals(received.toString(), 1, received.size());
    assertTrue(o.isDisposed());
}