private void fixGrace() {
        // Modify the elegant online and offline switches based on environment variables,
        // and this configuration has the highest priority
        final GraceConfig graceConfig = PluginConfigManager.getPluginConfig(GraceConfig.class);
        graceConfig.fixGraceSwitch();
        if (graceConfig.isEnableSpring() && graceConfig.isEnableGraceShutdown()) {
            Runtime.getRuntime().addShutdownHook(new GraceShutdownHook());
        }
    }
@Test
    public void testFixGrace() {
        final RegistryConfigSubscribeServiceImpl service = new RegistryConfigSubscribeServiceImpl();
        try (final MockedStatic<PluginConfigManager> pluginConfigManagerMockedStatic = Mockito.mockStatic(PluginConfigManager.class);){
            final GraceConfig graceConfig = new GraceConfig();
            pluginConfigManagerMockedStatic.when(() -> PluginConfigManager.getPluginConfig(GraceConfig.class))
                    .thenReturn(graceConfig);
            final Map<String, String> env = Collections.singletonMap(GraceConstants.ENV_GRACE_ENABLE, "true");
            EnvUtils.addEnv(env);
            ReflectUtils.invokeMethod(service, "fixGrace", null, null);
            Assert.assertTrue(graceConfig.isEnableGraceShutdown());
            Assert.assertTrue(graceConfig.isEnableOfflineNotify());
            Assert.assertTrue(graceConfig.isEnableWarmUp());
            EnvUtils.delEnv(env);
        } catch (Exception exception) {
            // ignored
        }
    }