@Test
    void releaseWhenWritingToClosedStream_HttpData() {
        final StreamWriter<HttpData> stream = new DefaultStreamMessage<>();
        final ByteBuf buf = PooledByteBufAllocator.DEFAULT.buffer().writeByte(0).retain();
        stream.close();

        await().untilAsserted(() -> assertThat(stream.isOpen()).isFalse());
        assertThat(stream.tryWrite(HttpData.wrap(buf))).isFalse();
        assertThat(buf.refCnt()).isOne();
        assertThatThrownBy(() -> stream.write(HttpData.wrap(buf))).isInstanceOf(ClosedStreamException.class);
        assertThat(buf.refCnt()).isZero();
    }
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