@VisibleForTesting
    ArrayDeque<NetworkSequenceViewReader> getAvailableReaders() {
        return availableReaders;
    }
@Test
    void testEnqueueReaderByNotifyingEventBuffer() throws Exception {
        // setup
        final ResultSubpartitionView view = new NextIsEventResultSubpartitionView();

        ResultPartition partition =
                TestingResultPartition.newBuilder()
                        .setCreateSubpartitionViewFunction((index, listener) -> view)
                        .build();

        final InputChannelID receiverId = new InputChannelID();
        final PartitionRequestQueue queue = new PartitionRequestQueue();
        final CreditBasedSequenceNumberingViewReader reader =
                new CreditBasedSequenceNumberingViewReader(receiverId, 0, queue);
        final EmbeddedChannel channel = new EmbeddedChannel(queue);

        reader.notifySubpartitionsCreated(partition, new ResultSubpartitionIndexSet(0));

        // block the channel so that we see an intermediate state in the test
        ByteBuf channelBlockingBuffer = blockChannel(channel);
        assertThat((Object) channel.readOutbound()).isNull();

        // Notify an available event buffer to trigger enqueue the reader
        reader.notifyDataAvailable(view);

        channel.runPendingTasks();

        // The reader is enqueued in the pipeline because the next buffer is an event, even though
        // no credits are available
        assertThat(queue.getAvailableReaders()).contains(reader); // contains only (this) one!
        assertThat(reader.getNumCreditsAvailable()).isZero();

        // Flush the buffer to make the channel writable again and see the final results
        channel.flush();
        assertThat((ByteBuf) channel.readOutbound()).isSameAs(channelBlockingBuffer);

        assertThat(queue.getAvailableReaders()).isEmpty();
        assertThat(reader.getNumCreditsAvailable()).isZero();
        assertThat((Object) channel.readOutbound()).isNull();
    }