code: public synchronized boolean isEmpty(short sessionId)
     {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "isEmpty","sessionId="+sessionId);
  
        boolean isEmpty = true;
  
        // If the underlying queue has no items on it, we are undoubtably empty
        if (!isQueueEmpty())
        {
           // If not, check the next item on the queue and see if it belongs to us. If it does and
           // a complete batch is ready - nice
           QueueData data = queue.getFirst();
           if (data.getProxyQueue().getId() == sessionId && batchesReady > 0)
           {
              isEmpty = false;
           }
        }
  
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "isEmpty", ""+isEmpty);
        return isEmpty;
     }
docs: This method will check and see if the queue is 'empty' - i.e. checks to see if messages are
  ready to be consumed from it. This method takes a sessionId parameter as it is possible that
  multiple sessions are using this queue and the queue may appear empty to one when messages
  are ready (not-empty) for another session.
  <p>
  So the checks are:
  <ul>
  <li>Has the underlying queue got 0 items on it? If yes, we are empty.</li>
  <li>Does the next item of data on the queue belong to this session Id? If it does and the
  queue contains at least one batch, we are _not_ empty.
  </ul>
  
  @param sessionId The session Id to check
  
  @return true if there are messages ready to be consumed by this session Id,
  otherwise false.
  
  @see com.ibm.ws.sib.comms.client.proxyqueue.queue.Queue#isEmpty(short)