@VisibleForTesting
    List<Buffer> getInflightBuffers(long checkpointId) {
        synchronized (receivedBuffers) {
            return getInflightBuffersUnsafe(checkpointId);
        }
    }
@Test
    void testGetInflightBuffersOverflow() throws Exception {
        for (int startingSequence = Integer.MAX_VALUE - 10;
                startingSequence != Integer.MIN_VALUE + 2;
                startingSequence++) {
            final RemoteInputChannel channel = buildInputGateAndGetChannel(startingSequence);
            int bufferSize = 1;
            int sequenceNumber = startingSequence;
            sendBuffer(channel, sequenceNumber++, bufferSize++);
            sendBuffer(channel, sequenceNumber++, bufferSize++);
            sendBarrier(channel, sequenceNumber++, UNALIGNED);
            sendBuffer(channel, sequenceNumber++, bufferSize++);
            sendBuffer(channel, sequenceNumber++, bufferSize++);
            assertThat(toBufferSizes(channel.getInflightBuffers(CHECKPOINT_ID)))
                    .withFailMessage("For starting sequence " + startingSequence)
                    .contains(1, 2);
        }
    }