@Override
    public CompletableFuture<?> getAvailableFuture() {
        return targetPartition.getAvailableFuture();
    }
@TestTemplate
    void testIsAvailableOrNot() throws Exception {
        // setup
        final NetworkBufferPool globalPool = new NetworkBufferPool(10, 128);
        final BufferPool localPool = globalPool.createBufferPool(1, 1, 1, Integer.MAX_VALUE, 0);
        final ResultPartitionWriter resultPartition =
                new ResultPartitionBuilder().setBufferPoolFactory(() -> localPool).build();
        resultPartition.setup();

        final RecordWriter<?> recordWriter = createRecordWriter(resultPartition);

        try {
            // record writer is available because of initial available global pool
            assertThat(recordWriter.getAvailableFuture()).isDone();

            // request one buffer from the local pool to make it unavailable afterwards
            try (BufferBuilder bufferBuilder = localPool.requestBufferBuilder(0)) {
                assertThat(bufferBuilder).isNotNull();
                assertThat(recordWriter.getAvailableFuture()).isNotDone();

                // recycle the buffer to make the local pool available again
                final Buffer buffer = BufferBuilderTestUtils.buildSingleBuffer(bufferBuilder);
                buffer.recycleBuffer();
            }
            assertThat(recordWriter.getAvailableFuture()).isDone();
            assertThat(recordWriter.getAvailableFuture()).isEqualTo(recordWriter.AVAILABLE);

        } finally {
            localPool.lazyDestroy();
            globalPool.destroy();
        }
    }