public void broadcastEvent(AbstractEvent event) throws IOException {
        broadcastEvent(event, false);
    }
@TestTemplate
    void testBroadcastEventBufferReferenceCounting() throws Exception {
        int bufferSize = 32 * 1024;
        int numSubpartitions = 2;

        ResultPartition partition = createResultPartition(bufferSize, numSubpartitions);
        RecordWriter<?> writer = createRecordWriter(partition);

        writer.broadcastEvent(EndOfPartitionEvent.INSTANCE);

        // get references to buffer consumers (copies from the original event buffer consumer)
        Buffer[] buffers = new Buffer[numSubpartitions];

        // process all collected events (recycles the buffer)
        for (int i = 0; i < numSubpartitions; i++) {
            assertThat(partition.getNumberOfQueuedBuffers(i)).isOne();
            ResultSubpartitionView view =
                    partition.createSubpartitionView(
                            new ResultSubpartitionIndexSet(i), new NoOpBufferAvailablityListener());
            buffers[i] = view.getNextBuffer().buffer();
            assertThat(parseBuffer(buffers[i], i).isEvent()).isTrue();
        }

        for (int i = 0; i < numSubpartitions; ++i) {
            assertThat(buffers[i].isRecycled()).isTrue();
        }
    }