@Test
public void fusedAPICalls() {

    Flowable.fromIterable(Arrays.asList(1, 2, 3))
    .subscribe(new FlowableSubscriber<Integer>() {
        @Override
        public void onSubscribe(Subscription s) {
            @SuppressWarnings("unchecked")
            QueueSubscription<Integer> qs = (QueueSubscription<Integer>)s;
            assertFalse(qs.isEmpty());
            try {
                assertEquals(1, qs.poll().intValue());
            } catch (Exception ex) {
                throw new AssertionError(ex);
            }
            assertFalse(qs.isEmpty());
            qs.clear();
            List<Throwable> errors = TestHelper.trackPluginErrors();
            try {
                qs.request(-99);
                TestHelper.assertError(errors, 0, IllegalArgumentException.class, "n > 0 required but it was -99");
            } finally {
                RxJavaPlugins.reset();
            }
        }
        @Override
        public void onNext(Integer t) {
        }
        @Override
        public void onError(Throwable t) {
        }
        @Override
        public void onComplete() {
        }
    });
}