public boolean removeFromTempQueueEvents(Object tailKey) {
    synchronized (queuedEventsSync) {
      Iterator<TmpQueueEvent> itr = tmpQueuedEvents.iterator();
      while (itr.hasNext()) {
        TmpQueueEvent event = itr.next();
        if (tailKey.equals(event.getEvent().getTailKey())) {
          if (logger.isDebugEnabled()) {
            logger.debug(
                "shadowKey {} is found in tmpQueueEvents at AbstractGatewaySender level. Removing from there..",
                tailKey);
          }
          event.release();
          itr.remove();
          return true;
        }
      }
      return false;
    }
  }
Removes the EntryEventImpl, whose tailKey matches with the provided tailKey, from
tmpQueueEvents.
geode-core/src/main/java/org/apache/geode/internal/cache/wan/AbstractGatewaySender.java