@Override
    public RaftMessage poll(long timeoutMs) {
        wakeupRequested.set(false);
        lastPollTimeout.set(timeoutMs);
        return messages.poll();
    }
Mocked implementation which does not block in {@link #poll(long)}..
raft/src/test/java/org/apache/kafka/raft/MockMessageQueue.java