code: private boolean hasMessagesPending()
    {
  
      for (Map.Entry<MessageQueue, ConcurrentSkipListSet<MessageExt>> entry : messageQueueTreeSetMap.entrySet()) {
        if (!entry.getValue().isEmpty()) {
          return true;
        }
      }
  
      return false;
    }
docs: Check if there are locally pending messages to consume.
  
  @return true if there are some; false otherwise.