docs: private void cleanUpEventLists(DCache cache, HashMap invalidateIdEvents, HashMap invalidateTemplateEvents, ArrayList pushEntryEvents, ArrayList pushECFEvents,
                                     ArrayList aliasEntryEvents) { //245015
  
          // Remove invalidateByIdEvent if the CacheEntry is newer than the invalidate request.
          Iterator it = invalidateIdEvents.values().iterator();
          while (it.hasNext()) {
              InvalidateByIdEvent invalidateByIdEvent = (InvalidateByIdEvent) it.next();
              Object id = invalidateByIdEvent.getId();
              CacheEntry cacheEntry = cache.getEntryFromMemory(id); //245015
              // In PushPull mode, dmap.put() --> cache.invalidateAndSet() --> (1) get old value; (2) invalidate but not performing renounce id
              // in DRS's BatchUpdate. The not-InvalidateByIdEvent.INVOKE_DRS_RENOUNCE ('False') will be passed when creating InvalidateByEvent;
              // (3)put entry in memory and performing announce id in DRS's BatchUpdate. For this case, we need to keep both invalidate event
              // in the InvalidateIdEvents and id in the PushEntryEvents. 
              if (cacheEntry != null &&
                  invalidateByIdEvent.getTimeStamp() < cacheEntry.getTimeStamp() &&
                  invalidateByIdEvent.isInvokeDRSRenounce() == true) { //495487
                  if (tc.isDebugEnabled()) {
                      Tr.debug(tc, "cleanUpEventLists(): Filtered out InvalidateByIdEvent when cache entry is newer in memory cache. cacheName=" + cache.getCacheName() + " id=" + id);
  
                  }
                  it.remove();
              }
          }
  
          // check pushEntryEvents to see if id, data ids, or template are in invalidate lists
          it = pushEntryEvents.iterator();
          while (it.hasNext()) {
              boolean remove = false;
              CacheEntry cacheEntry = (CacheEntry) it.next();
              if (invalidateIdEvents.containsKey(cacheEntry.getIdObject())) {
                  InvalidateByIdEvent invalidateByIdEvent = (InvalidateByIdEvent) invalidateIdEvents.get(cacheEntry.getIdObject());
                  // In PushPull mode, dmap.put() --> cache.invalidateAndSet() --> (1) get old value; (2) invalidate but not performing renounce id
                  // in DRS's BatchUpdate. The not-InvalidateByIdEvent.INVOKE_DRS_RENOUNCE ('False') will be passed when creating InvalidateByEvent;
                  // (3)put entry in memory and performing announce id in DRS's BatchUpdate. For this case, we need to keep both invalidate event
                  // in the InvalidateIdEvents and id in the PushEntryEvents. 
                  if (invalidateByIdEvent.isInvokeDRSRenounce() == true) { //495487
                      remove = true;
                      if (tc.isDebugEnabled()) {
                          Tr.debug(tc,
                                   "cleanUpEventLists(): Filtered out pushEntryEvents when id is n invalidation list. cacheName=" + cache.getCacheName() + " id="
                                                   + cacheEntry.getIdObject());
                      }
                  }
              }
              if (!remove) {
                  Enumeration e = cacheEntry.getDataIds();
                  while (e.hasMoreElements()) {
                      Object did = e.nextElement();
                      if (invalidateIdEvents.containsKey(did)) {
                          remove = true;
                          if (tc.isDebugEnabled()) {
                              Tr.debug(tc, "cleanUpEventLists(): Filtered out pushEntryEvents when dependency id is in invalidation list. cacheName=" + cache.getCacheName() + " id="
                                           + cacheEntry.getIdObject() + " depid=" + did);
                          }
                          break;
                      }
                  }
              }
              if (!remove) {
                  Enumeration e = cacheEntry.getTemplates();
                  while (e.hasMoreElements()) {
                      Object template = e.nextElement();
                      if (invalidateIdEvents.containsKey(template)) {
                          remove = true;
                          if (tc.isDebugEnabled()) {
                              Tr.debug(tc, "cleanUpEventLists(): Filtered out pushEntryEvents when template is in invalidation list. cacheName=" + cache.getCacheName() + " id="
                                           + cacheEntry.getIdObject() + " template=" + template);
                          }
                          break;
                      }
                  }
              }
  
              // Remove PUSH event if the ce is not serializable
              if (!remove && !cacheEntry.prepareForSerialization()) {
                  // a msg was logged during the above call
                  remove = true;
              }
  
              if (remove) {
                  it.remove();
              }
          }
  
          // check aliasEntryEvents to see if id is in invalidate lists or 
          // the CacheEntry is newer than the add/remove alias request.
          it = aliasEntryEvents.iterator();
          while (it.hasNext()) {
              boolean remove = false;
              AliasEntry aliasEntry = (AliasEntry) it.next();
              if (invalidateIdEvents.containsKey(aliasEntry.id)) {
                  remove = true;
              } else {
                  Iterator it_ce = pushEntryEvents.iterator();
                  while (it_ce.hasNext()) {
                      CacheEntry cacheEntry = (CacheEntry) it_ce.next();
                      if (cacheEntry.getIdObject().equals(aliasEntry.id)) {
                          if (cacheEntry.getTimeStamp() > aliasEntry.getTimeStamp()) {
                              remove = true;
                              if (tc.isDebugEnabled()) {
                                  Tr.debug(tc, "cleanUpEventLists(): Filtered out aliasEntryEvents when cache entry is newer than alias request. cacheName=" + cache.getCacheName()
                                               + " id=" + cacheEntry.getIdObject());
                              }
                              break;
                          }
                      }
                  }
              }
              if (remove) {
                  it.remove();
              }
          }
  
          //check pushECFEvents to make sure they should not be invalidated
          it = pushECFEvents.iterator();
          while (it.hasNext()) {
              boolean remove = false;
              ExternalInvalidation externalCacheFragment = (ExternalInvalidation) it.next();
  
              Enumeration enumeration = externalCacheFragment.getTemplates();
              while (!remove && enumeration.hasMoreElements()) {
                  String template = (String) enumeration.nextElement();
                  if (invalidateTemplateEvents.containsKey(template)) {
                      remove = true;
                      if (tc.isDebugEnabled()) {
                          Tr.debug(tc, "cleanUpEventLists(): Filtered out pushECFEvents when template is in invalidation list. cacheName=" + cache.getCacheName() + " template="
                                       + template);
                      }
                  }
              }
  
              enumeration = externalCacheFragment.getInvalidationIds();
              while (!remove && enumeration.hasMoreElements()) {
                  String id = (String) enumeration.nextElement();
                  if (invalidateIdEvents.containsKey(id)) {
                      remove = true;
                      if (tc.isDebugEnabled()) {
                          Tr.debug(tc, "cleanUpEventLists(): Filtered out pushECFEvents when invalidation id is in invalidation list. cacheName=" + cache.getCacheName() + " ide="
                                       + id);
                      }
                  }
              }
  
              if (remove)
                  it.remove();
          }
  
      }