code: public static void shutdownNodeByFiringEvents(Node node, boolean terminate) {
          final HazelcastInstanceImpl hazelcastInstance = node.hazelcastInstance;
          final LifecycleServiceImpl lifecycleService = hazelcastInstance.getLifecycleService();
          lifecycleService.fireLifecycleEvent(LifecycleEvent.LifecycleState.SHUTTING_DOWN);
          node.shutdown(terminate);
          lifecycleService.fireLifecycleEvent(LifecycleEvent.LifecycleState.SHUTDOWN);
      }
docs: Shutdowns a node by firing lifecycle events. Do not call this method for every node shutdown scenario
  since {@link com.hazelcast.core.LifecycleListener}s will end up more than one
  {@link com.hazelcast.core.LifecycleEvent.LifecycleState#SHUTTING_DOWN}
  or {@link com.hazelcast.core.LifecycleEvent.LifecycleState#SHUTDOWN} events.
  
  @param node      Node to shutdown.
  @param terminate <code>false</code> for graceful shutdown, <code>true</code> for terminate (un-graceful shutdown)