public boolean isNamespaceReferencedWithHotRestart(@Nonnull String namespace)  {
        return nodeEngine.getConfig()
                .getCacheConfigs()
                .values()
                .stream()
                .filter(cacheConfig -> cacheConfig.getDataPersistenceConfig().isEnabled())
                .map(CacheSimpleConfig::getUserCodeNamespace)
                .anyMatch(namespace::equals)
                || getCacheConfigs()
                .stream()
                .filter(cacheConfig -> cacheConfig.getHotRestartConfig().isEnabled())
                .map(CacheConfig::getUserCodeNamespace)
                .anyMatch(namespace::equals);
    }
@Test
    public void testIsNamespaceReferencedWithHotRestart_withSimpleCacheConfigs_true() {
        CacheService cacheService = new TestCacheService(mockNodeEngine, true);
        CacheSimpleConfig cacheConfigMock = Mockito.mock(CacheSimpleConfig.class);
        DataPersistenceConfig dataPersistenceConfigMock = Mockito.mock(DataPersistenceConfig.class);
        when(dataPersistenceConfigMock.isEnabled()).thenReturn(true);
        when(cacheConfigMock.getDataPersistenceConfig()).thenReturn(dataPersistenceConfigMock);
        when(cacheConfigMock.getUserCodeNamespace()).thenReturn("ns1");
        when(cacheConfigMock.getDataPersistenceConfig()).thenReturn(dataPersistenceConfigMock);
        when(mockConfig.getCacheConfigs()).thenReturn(Map.of("test-cache", cacheConfigMock));
        assertTrue(cacheService.isNamespaceReferencedWithHotRestart("ns1"));
    }