boolean isEmpty() {
        try {
            lock.lock();
            return completedFetches.isEmpty();
        } finally {
            lock.unlock();
        }
    }
Returns {@code true} if there are no completed fetches pending to return to the user.

@return {@code true} if the buffer is empty, {@code false} otherwise
clients/src/main/java/org/apache/kafka/clients/consumer/internals/FetchBuffer.java