@Override
        public void run() {
            try {
                pool.allocate(2, maxBlockTimeMs);
                fail("The buffer allocated more memory than its maximum value 2");
            } catch (BufferExhaustedException e) {
                // this is good
            } catch (InterruptedException e) {
                // this can be neglected
            }
        }
Test if the  waiter that is waiting on availability of more memory is cleaned up when an interruption occurs
clients/src/test/java/org/apache/kafka/clients/producer/internals/BufferPoolTest.java