@Test
    void requestWithNegativeValue() {
        final StreamWriter<HttpData> stream = new DefaultStreamMessage<>();
        final ByteBuf buf = PooledByteBufAllocator.DEFAULT.buffer().writeByte(0);
        stream.write(HttpData.wrap(buf).withEndOfStream());

        final AtomicBoolean onErrorCalled = new AtomicBoolean();
        stream.subscribe(new Subscriber<HttpData>() {
            @Override
            public void onSubscribe(Subscription s) {
                s.request(-1);
            }

            @Override
            public void onNext(HttpData o) {}

            @Override
            public void onError(Throwable t) {
                onErrorCalled.set(true);
            }

            @Override
            public void onComplete() {}
        }, ImmediateEventExecutor.INSTANCE);

        assertThat(onErrorCalled.get()).isTrue();
        assertThat(buf.refCnt()).isZero();
        assertThatThrownBy(() -> stream.whenComplete().get())
                .hasCauseInstanceOf(IllegalArgumentException.class)
                .hasMessageContaining("expected: > 0");
    }
Makes sure {@link Subscriber#onComplete()} is always invoked after
{@link Subscriber#onSubscribe(Subscription)} even if
{@link StreamMessage#subscribe(Subscriber, EventExecutor, SubscriptionOption...)}
is called from non-{@link EventLoop}.
core/src/test/java/com/linecorp/armeria/common/stream/DefaultStreamMessageTest.java