void writeInput(
            JobVertexID jobVertexID, int subtaskIndex, InputChannelInfo info, Buffer buffer) {
        try {
            if (isDone()) {
                return;
            }
            ChannelStatePendingResult pendingResult =
                    getChannelStatePendingResult(jobVertexID, subtaskIndex);
            write(
                    pendingResult.getInputChannelOffsets(),
                    info,
                    buffer,
                    !pendingResult.isAllInputsReceived(),
                    "ChannelStateCheckpointWriter#writeInput");
        } finally {
            buffer.recycleBuffer();
        }
    }
@Test
    void testRecyclingBuffers() {
        ChannelStateCheckpointWriter writer = createWriter(new ChannelStateWriteResult());
        NetworkBuffer buffer =
                new NetworkBuffer(
                        MemorySegmentFactory.allocateUnpooledSegment(10),
                        FreeingBufferRecycler.INSTANCE);
        writer.writeInput(JOB_VERTEX_ID, SUBTASK_INDEX, new InputChannelInfo(1, 2), buffer);
        assertThat(buffer.isRecycled()).isTrue();
    }