@Test
public void doubleOnSubscribe() {

    TestSubscriber<Integer> ts = new TestSubscriber<Integer>();
    SubscriberWrapper<Integer> wrapper = new SubscriberWrapper<Integer>(ts);
    new Flowable<Integer>() {
        @Override
        protected void subscribeActual(Subscriber<? super Integer> s) {
            BooleanSubscription b1 = new BooleanSubscription();
            s.onSubscribe(b1);
            BooleanSubscription b2 = new BooleanSubscription();
            s.onSubscribe(b2);
            assertTrue(b1.isCancelled());
            assertTrue(b2.isCancelled());
        }
    }.subscribe(wrapper);
    ts.assertFailure(IllegalStateException.class);
    assertTrue(ts.errors().toString(), ts.errors().get(0).getMessage().contains("2.12"));
}