@Override
    public void shutdown() {
        if (SHUTDOWN.compareAndSet(false, true)) {
            Object registration = GraceContext.INSTANCE.getGraceShutDownManager().getRegistration();
            ReflectUtils.invokeMethodWithNoneParameter(registration, REGISTRATION_DEREGISTER_METHOD_NAME);
            checkAndCloseSc();
            GraceContext.INSTANCE.getGraceShutDownManager().setShutDown(true);
            ClientInfo clientInfo = RegisterContext.INSTANCE.getClientInfo();
            Map<String, Collection<String>> header = new HashMap<>();
            header.put(GraceConstants.MARK_SHUTDOWN_SERVICE_NAME,
                    Collections.singletonList(clientInfo.getServiceName()));
            header.put(GraceConstants.MARK_SHUTDOWN_SERVICE_ENDPOINT,
                    Arrays.asList(clientInfo.getIp() + ":" + clientInfo.getPort(),
                            clientInfo.getHost() + ":" + clientInfo.getPort()));
            AddressCache.INSTANCE.getAddressSet().forEach(address -> notifyToGraceHttpServer(address, header));
        }
    }
@Test
    public void testShutDown() {
        final GraceServiceImpl spy = Mockito.spy(new GraceServiceImpl());
        spy.shutdown();
        spy.addAddress("test");
        Mockito.doCallRealMethod().when(spy).shutdown();
        Mockito.verify(spy, Mockito.times(1)).shutdown();
        Mockito.verify(spy, Mockito.times(1)).addAddress("test");
        Assert.assertFalse(AddressCache.INSTANCE.getAddressSet().isEmpty());
        final Optional<Object> shutdown = ReflectUtils.getFieldValue(spy, "SHUTDOWN");
        Assert.assertTrue(shutdown.isPresent() && shutdown.get() instanceof AtomicBoolean);
        Assert.assertTrue(((AtomicBoolean) shutdown.get()).get());
    }