private Callable<Void> recordingCallable(Map<String, Object> recordingMap, String success, TestException failure) {
        return () -> {
            if (success == null)
                recordingMap.put(failure.key, failure);
            else if (failure == null)
                recordingMap.put(success, success);
            else
                throw new IllegalArgumentException("Either `success` or `failure` must be null, but both are non-null.");

            return null;
        };
    }
Expectation setter for multiple reads where each one reads random bytes to the buffer.

@param channelMock           The mocked FileChannel object
@param bufferSize            The buffer size
@return Expected buffer string
@throws IOException          If an I/O error occurs
clients/src/test/java/org/apache/kafka/common/utils/UtilsTest.java