@Test
    void circularQueueEvenNumHeadWrapAround() {
        final SignalQueue queue = new SignalQueue(obj -> 4);
        add(queue, 0, 10);
        assertRefCnt(0, 10, 1);

        queue.requestRemovalAheadOf(10);
        add(queue, 10, 20);
        assertRefCnt(0, 10, 0);
        assertRefCnt(10, 20, 1);

        queue.requestRemovalAheadOf(20); // first head wrap around
        add(queue, 20, 30);
        assertRefCnt(0, 20, 0);
        assertRefCnt(20, 30, 1);

        queue.requestRemovalAheadOf(30);
        add(queue, 30, 40);
        assertRefCnt(0, 30, 0);
        assertRefCnt(30, 40, 1);

        queue.requestRemovalAheadOf(40); // second head wrap around
        add(queue, 40, 60);              // queue expansion happens
        assertRefCnt(0, 40, 0);
        assertRefCnt(40, 60, 1);
        for (int i = 40; i < 60; i++) {
            assertThat(((HttpData) queue.get(i)).byteBuf().readInt()).isEqualTo(i);
        }
        queue.clear(null);
        assertRefCnt(0, 60, 0);
    }
A test for the {@link SignalQueue} in {@link DefaultStreamMessageDuplicator}.
Queue expansion behaves differently when odd/even number head wrap-around happens.
core/src/test/java/com/linecorp/armeria/common/stream/StreamMessageDuplicatorTest.java