@Override
  public Object peek() throws CacheException {
    KeyAndEventPair object = peekAhead();
    if (logger.isTraceEnabled()) {
      logger.trace("{}: Peeked {} -> {}", this, peekedIds, object);
    }

    return object.event;
    // OFFHEAP returned object only used to see if queue is empty
    // so no need to worry about off-heap refCount.
  }
This method removes batchSize entries from the queue. It will only remove entries that were
previously peeked.

@param size the number of entries to remove
geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueue.java