void clear(@Nullable Throwable cause) {
            final Object[] oldElements = elements;
            if (oldElements == null) {
                return; // Already cleared.
            }
            elements = null;

            int end = tail;
            if (end < head) {
                // odd number head wrap-around e.g. [8, N, N, N, N, 5, 6, 7]
                end += oldElements.length;
            }

            final int bitMask = oldElements.length - 1;
            for (int i = head; i < end; i++) {
                StreamMessageUtil.closeOrAbort(oldElements[i & bitMask], cause);
            }
        }
Invoked by the executor in {@link DownstreamSubscription}.
core/src/main/java/com/linecorp/armeria/common/stream/DefaultStreamMessageDuplicator.java