@Override
    public synchronized void wakeup() {
        if (numBlockingWakeups > 0) {
            numBlockingWakeups--;
            notify();
        }
        if (wakeupHook != null) {
            wakeupHook.run();
        }
    }
Simulate a blocking poll in order to test wakeup behavior.

@param numBlockingWakeups The number of polls which will block until woken up
clients/src/test/java/org/apache/kafka/clients/MockClient.java