@Override
    public void onOutOfMemory(OutOfMemoryError oome, HazelcastInstance[] hazelcastInstances) {
        for (HazelcastInstance instance : hazelcastInstances) {
            if (instance instanceof HazelcastInstanceImpl) {
                OutOfMemoryHandlerHelper.tryCloseConnections(instance);
                OutOfMemoryHandlerHelper.tryShutdown(instance);
            }
        }
        try {
            oome.printStackTrace(System.err);
        } catch (Throwable ignored) {
            ignore(ignored);
        }
    }
@Test
    public void testOnOutOfMemory() {
        outOfMemoryHandler.onOutOfMemory(new OutOfMemoryError(), instances);

        assertFalse("The member should be shutdown", hazelcastInstance.getLifecycleService().isRunning());
    }