docs: private String registerNodeShutdownListener() {
          HazelcastInstance node = nodeEngine.getHazelcastInstance();
          LifecycleService lifecycleService = node.getLifecycleService();
          return lifecycleService.addLifecycleListener(new LifecycleListener() {
              @Override
              public void stateChanged(LifecycleEvent event) {
                  if (event.getState() == SHUTTING_DOWN) {
                      Set<Map.Entry<String, InvalidationQueue<Invalidation>>> entries = invalidationQueues.entrySet();
                      for (Map.Entry<String, InvalidationQueue<Invalidation>> entry : entries) {
                          pollAndSendInvalidations(entry.getKey(), entry.getValue());
                      }
                  }
              }
          });
      }