@Override
    public Config build() {
        return build(new Config());
    }
@Override
    @Test
    public void testQueryCacheFullConfig() {
        String yaml = """
                hazelcast:
                  map:
                    test:
                      query-caches:
                        cache-name:
                          entry-listeners:
                            - class-name: com.hazelcast.examples.EntryListener
                              include-value: true
                              local: false
                          include-value: true
                          batch-size: 1
                          buffer-size: 16
                          delay-seconds: 0
                          in-memory-format: BINARY
                          coalesce: false
                          populate: true
                          serialize-keys: true
                          indexes:
                            - type: HASH
                              attributes:
                                - "name"
                          predicate:
                            class-name: com.hazelcast.examples.SimplePredicate
                          eviction:
                            eviction-policy: LRU
                            max-size-policy: ENTRY_COUNT
                            size: 133
                """;

        Config config = buildConfig(yaml);
        QueryCacheConfig queryCacheConfig = config.getMapConfig("test").getQueryCacheConfigs().get(0);
        EntryListenerConfig entryListenerConfig = queryCacheConfig.getEntryListenerConfigs().get(0);

        assertEquals("cache-name", queryCacheConfig.getName());
        assertTrue(entryListenerConfig.isIncludeValue());
        assertFalse(entryListenerConfig.isLocal());
        assertEquals("com.hazelcast.examples.EntryListener", entryListenerConfig.getClassName());
        assertTrue(queryCacheConfig.isIncludeValue());
        assertEquals(1, queryCacheConfig.getBatchSize());
        assertEquals(16, queryCacheConfig.getBufferSize());
        assertEquals(0, queryCacheConfig.getDelaySeconds());
        assertEquals(InMemoryFormat.BINARY, queryCacheConfig.getInMemoryFormat());
        assertFalse(queryCacheConfig.isCoalesce());
        assertTrue(queryCacheConfig.isPopulate());
        assertTrue(queryCacheConfig.isSerializeKeys());
        assertIndexesEqual(queryCacheConfig);
        assertEquals("com.hazelcast.examples.SimplePredicate", queryCacheConfig.getPredicateConfig().getClassName());
        assertEquals(LRU, queryCacheConfig.getEvictionConfig().getEvictionPolicy());
        assertEquals(ENTRY_COUNT, queryCacheConfig.getEvictionConfig().getMaxSizePolicy());
        assertEquals(133, queryCacheConfig.getEvictionConfig().getSize());
    }

    private void assertIndexesEqual(QueryCacheConfig queryCacheConfig) {
        for (IndexConfig indexConfig : queryCacheConfig.getIndexConfigs()) {
            assertEquals("name", indexConfig.getAttributes().get(0));
            assertFalse(indexConfig.getType() == IndexType.SORTED);
        }
    }

    @Override
    @Test
    public void testMapQueryCachePredicate() {
        String yaml = """
                hazelcast:
                  map:
                    test:
                      query-caches:
                        cache-class-name:
                          predicate:
                            class-name: com.hazelcast.examples.SimplePredicate
                        cache-sql:
                          predicate:
                            sql: "%age=40"
                """;

        Config config = buildConfig(yaml);
        QueryCacheConfig queryCacheClassNameConfig = config.getMapConfig("test").getQueryCacheConfigs().get(0);
        assertEquals("com.hazelcast.examples.SimplePredicate", queryCacheClassNameConfig.getPredicateConfig().getClassName());

        QueryCacheConfig queryCacheSqlConfig = config.getMapConfig("test").getQueryCacheConfigs().get(1);
        assertEquals("%age=40", queryCacheSqlConfig.getPredicateConfig().getSql());
    }

    @Override
    @Test
    public void testLiteMemberConfig() {
        String yaml = """
                hazelcast:
                  lite-member:
                    enabled: true
                """;

        Config config = buildConfig(yaml);

        assertTrue(config.isLiteMember());
    }

    @Override
    @Test
    public void testNonLiteMemberConfig() {
        String yaml = """
                hazelcast:
                  lite-member:
                    enabled: false
                """;

        Config config = buildConfig(yaml);

        assertFalse(config.isLiteMember());
    }

    @Override
    @Test(expected = SchemaViolationConfigurationException.class)
    public void testNonLiteMemberConfigWithoutEnabledField() {
        String yaml = """
                hazelcast:
                  lite-member: {}
                """;

        buildConfig(yaml);
    }

    @Override
    @Test(expected = SchemaViolationConfigurationException.class)
    public void testInvalidLiteMemberConfig() {
        String yaml = """
                hazelcast:
                  lite-member:
                    enabled: dummytext
                """;

        buildConfig(yaml);
    }

    @Override
    @Test(expected = InvalidConfigurationException.class)
    public void testDuplicateLiteMemberConfig() {
        String yaml = """
                hazelcast:
                  lite-member:
                    enabled: true
                  lite-member:
                    enabled: true
                """;

        buildConfig(yaml);
        fail();
    }

    private static void assertIndexEqual(String expectedAttribute, boolean expectedOrdered, IndexConfig indexConfig) {
        assertEquals(expectedAttribute, indexConfig.getAttributes().get(0));
        assertEquals(expectedOrdered, indexConfig.getType() == IndexType.SORTED);
    }

    @Override
    @Test
    public void testMapNativeMaxSizePolicy() {
        String yamlFormat = """
                hazelcast:
                  map:
                    mymap:
                      in-memory-format: NATIVE
                      eviction:
                        max-size-policy: "{0}"
                        size: 9991
                """;

        MessageFormat messageFormat = new MessageFormat(yamlFormat);

        MaxSizePolicy[] maxSizePolicies = MaxSizePolicy.values();
        for (MaxSizePolicy maxSizePolicy : maxSizePolicies) {
            if (maxSizePolicy == ENTRY_COUNT) {
                // imap does not support ENTRY_COUNT
                continue;
            }
            Object[] objects = {maxSizePolicy.toString()};
            String yaml = messageFormat.format(objects);
            Config config = buildConfig(yaml);
            MapConfig mapConfig = config.getMapConfig("mymap");
            EvictionConfig evictionConfig = mapConfig.getEvictionConfig();

            assertEquals(9991, evictionConfig.getSize());
            assertEquals(maxSizePolicy, evictionConfig.getMaxSizePolicy());
        }
    }

    @Override
    @Test
    public void testInstanceName() {
        String name = randomName();
        String yaml = ""
                + "hazelcast:\n"
                + " instance-name: " + name + "\n";

        Config config = buildConfig(yaml);
        assertEquals(name, config.getInstanceName());
    }

    @Override
    @Test
    public void testUserCodeDeployment() {
        String yaml = """
                hazelcast:
                  user-code-deployment:
                    enabled: true
                    class-cache-mode: OFF
                    provider-mode: LOCAL_CLASSES_ONLY
                    blacklist-prefixes: com.blacklisted,com.other.blacklisted
                    whitelist-prefixes: com.whitelisted,com.other.whitelisted
                    provider-filter: HAS_ATTRIBUTE:foo
                """;

        Config config = new InMemoryYamlConfig(yaml);
        UserCodeDeploymentConfig dcConfig = config.getUserCodeDeploymentConfig();
        assertTrue(dcConfig.isEnabled());
        assertEquals(UserCodeDeploymentConfig.ClassCacheMode.OFF, dcConfig.getClassCacheMode());
        assertEquals(UserCodeDeploymentConfig.ProviderMode.LOCAL_CLASSES_ONLY, dcConfig.getProviderMode());
        assertEquals("com.blacklisted,com.other.blacklisted", dcConfig.getBlacklistedPrefixes());
        assertEquals("com.whitelisted,com.other.whitelisted", dcConfig.getWhitelistedPrefixes());
        assertEquals("HAS_ATTRIBUTE:foo", dcConfig.getProviderFilter());
    }

    @Override
    public void testEmptyUserCodeDeployment() {
        String yaml = """
                hazelcast:
                  user-code-deployment:
                    enabled: true
                """;

        Config config = buildConfig(yaml);
        UserCodeDeploymentConfig userCodeDeploymentConfig = config.getUserCodeDeploymentConfig();
        assertTrue(userCodeDeploymentConfig.isEnabled());
        assertEquals(UserCodeDeploymentConfig.ClassCacheMode.ETERNAL, userCodeDeploymentConfig.getClassCacheMode());
        assertEquals(UserCodeDeploymentConfig.ProviderMode.LOCAL_AND_CACHED_CLASSES, userCodeDeploymentConfig.getProviderMode());
        assertNull(userCodeDeploymentConfig.getBlacklistedPrefixes());
        assertNull(userCodeDeploymentConfig.getWhitelistedPrefixes());
        assertNull(userCodeDeploymentConfig.getProviderFilter());
    }

    @Override
    @Test
    public void testCRDTReplicationConfig() {
        final String yaml = """
                hazelcast:
                  crdt-replication:
                    max-concurrent-replication-targets: 10
                    replication-period-millis: 2000
                """;

        final Config config = new InMemoryYamlConfig(yaml);
        final CRDTReplicationConfig replicationConfig = config.getCRDTReplicationConfig();
        assertEquals(10, replicationConfig.getMaxConcurrentReplicationTargets());
        assertEquals(2000, replicationConfig.getReplicationPeriodMillis());
    }

    @Override
    @Test
    public void testGlobalSerializer() {
        String name = randomName();
        String val = "true";
        String yaml = ""
                + "hazelcast:\n"
                + "  serialization:\n"
                + "    global-serializer:\n"
                + "      class-name: " + name + "\n"
                + "      override-java-serialization: " + val + "\n";

        Config config = new InMemoryYamlConfig(yaml);
        GlobalSerializerConfig globalSerializerConfig = config.getSerializationConfig().getGlobalSerializerConfig();
        assertEquals(name, globalSerializerConfig.getClassName());
        assertTrue(globalSerializerConfig.isOverrideJavaSerialization());
    }

    @Override
    @Test
    public void testJavaSerializationFilter() {
        String yaml = """
                hazelcast:
                  serialization:
                    java-serialization-filter:
                      defaults-disabled: true
                      whitelist:
                        class:
                          - java.lang.String
                          - example.Foo
                        package:
                          - com.acme.app
                          - com.acme.app.subpkg
                        prefix:
                          - java
                          - com.hazelcast.
                          - "["
                      blacklist:
                        class:
                          - com.acme.app.BeanComparator
                """;

        Config config = new InMemoryYamlConfig(yaml);
        JavaSerializationFilterConfig javaSerializationFilterConfig
                = config.getSerializationConfig().getJavaSerializationFilterConfig();
        assertNotNull(javaSerializationFilterConfig);
        ClassFilter blackList = javaSerializationFilterConfig.getBlacklist();
        assertNotNull(blackList);
        ClassFilter whiteList = javaSerializationFilterConfig.getWhitelist();
        assertNotNull(whiteList);
        assertTrue(whiteList.getClasses().contains("java.lang.String"));
        assertTrue(whiteList.getClasses().contains("example.Foo"));
        assertTrue(whiteList.getPackages().contains("com.acme.app"));
        assertTrue(whiteList.getPackages().contains("com.acme.app.subpkg"));
        assertTrue(whiteList.getPrefixes().contains("java"));
        assertTrue(whiteList.getPrefixes().contains("["));
        assertTrue(blackList.getClasses().contains("com.acme.app.BeanComparator"));
    }

    @Override
    @Test
    public void testJavaReflectionFilter() {
        String yaml = """
                hazelcast:
                  sql:
                    java-reflection-filter:
                      defaults-disabled: true
                      whitelist:
                        class:
                          - java.lang.String
                          - example.Foo
                        package:
                          - com.acme.app
                          - com.acme.app.subpkg
                        prefix:
                          - java
                          - com.hazelcast.
                          - "["
                      blacklist:
                        class:
                          - com.acme.app.BeanComparator
                """;

        Config config = new InMemoryYamlConfig(yaml);
        JavaSerializationFilterConfig javaReflectionFilterConfig
            = config.getSqlConfig().getJavaReflectionFilterConfig();
        assertNotNull(javaReflectionFilterConfig);
        ClassFilter blackList = javaReflectionFilterConfig.getBlacklist();
        assertNotNull(blackList);
        ClassFilter whiteList = javaReflectionFilterConfig.getWhitelist();
        assertNotNull(whiteList);
        assertTrue(whiteList.getClasses().contains("java.lang.String"));
        assertTrue(whiteList.getClasses().contains("example.Foo"));
        assertTrue(whiteList.getPackages().contains("com.acme.app"));
        assertTrue(whiteList.getPackages().contains("com.acme.app.subpkg"));
        assertTrue(whiteList.getPrefixes().contains("java"));
        assertTrue(whiteList.getPrefixes().contains("["));
        assertTrue(blackList.getClasses().contains("com.acme.app.BeanComparator"));
    }

    @Override
    public void testCompactSerialization_serializerRegistration() {
        String yaml = """
                hazelcast:
                    serialization:
                        compact-serialization:
                            serializers:
                                - serializer: example.serialization.SerializableEmployeeDTOSerializer
                """;

        Config config = buildConfig(yaml);
        CompactTestUtil.verifyExplicitSerializerIsUsed(config.getSerializationConfig());
    }

    @Override
    public void testCompactSerialization_classRegistration() {
        String yaml = """
                hazelcast:
                    serialization:
                        compact-serialization:
                            classes:
                                - class: example.serialization.ExternalizableEmployeeDTO
                """;

        Config config = buildConfig(yaml);
        CompactTestUtil.verifyReflectiveSerializerIsUsed(config.getSerializationConfig());
    }

    @Override
    public void testCompactSerialization_serializerAndClassRegistration() {
        String yaml = """
                hazelcast:
                    serialization:
                        compact-serialization:
                            serializers:
                                - serializer: example.serialization.SerializableEmployeeDTOSerializer
                            classes:
                                - class: example.serialization.ExternalizableEmployeeDTO
                """;

        SerializationConfig config = buildConfig(yaml).getSerializationConfig();
        CompactTestUtil.verifyExplicitSerializerIsUsed(config);
        CompactTestUtil.verifyReflectiveSerializerIsUsed(config);
    }

    @Override
    public void testCompactSerialization_duplicateSerializerRegistration() {
        String yaml = """
                hazelcast:
                    serialization:
                        compact-serialization:
                            serializers:
                                - serializer: example.serialization.EmployeeDTOSerializer
                                - serializer: example.serialization.EmployeeDTOSerializer
                """;

        SerializationConfig config = buildConfig(yaml).getSerializationConfig();
        assertThatThrownBy(() -> CompactTestUtil.verifySerializationServiceBuilds(config))
                .isInstanceOf(InvalidConfigurationException.class)
                .hasMessageContaining("Duplicate");
    }

    @Override
    public void testCompactSerialization_duplicateClassRegistration() {
        String yaml = """
                hazelcast:
                    serialization:
                        compact-serialization:
                            classes:
                                - class: example.serialization.ExternalizableEmployeeDTO
                                - class: example.serialization.ExternalizableEmployeeDTO
                """;

        SerializationConfig config = buildConfig(yaml).getSerializationConfig();
        assertThatThrownBy(() -> CompactTestUtil.verifySerializationServiceBuilds(config))
                .isInstanceOf(InvalidConfigurationException.class)
                .hasMessageContaining("Duplicate");
    }

    @Override
    public void testCompactSerialization_registrationsWithDuplicateClasses() {
        String yaml = """
                hazelcast:
                    serialization:
                        compact-serialization:
                            serializers:
                                - serializer: example.serialization.EmployeeDTOSerializer
                                - serializer: example.serialization.SameClassEmployeeDTOSerializer
                """;

        SerializationConfig config = buildConfig(yaml).getSerializationConfig();
        assertThatThrownBy(() -> CompactTestUtil.verifySerializationServiceBuilds(config))
                .isInstanceOf(InvalidConfigurationException.class)
                .hasMessageContaining("Duplicate")
                .hasMessageContaining("class");
    }

    @Override
    public void testCompactSerialization_registrationsWithDuplicateTypeNames() {
        String yaml = """
                hazelcast:
                    serialization:
                        compact-serialization:
                            serializers:
                                - serializer: example.serialization.EmployeeDTOSerializer
                                - serializer: example.serialization.SameTypeNameEmployeeDTOSerializer
                """;

        SerializationConfig config = buildConfig(yaml).getSerializationConfig();
        assertThatThrownBy(() -> CompactTestUtil.verifySerializationServiceBuilds(config))
                .isInstanceOf(InvalidConfigurationException.class)
                .hasMessageContaining("Duplicate")
                .hasMessageContaining("type name");
    }

    @Override
    public void testCompactSerialization_withInvalidSerializer() {
        String yaml = """
                hazelcast:
                    serialization:
                        compact-serialization:
                            serializers:
                                - serializer: does.not.exist.FooSerializer
                """;

        SerializationConfig config = buildConfig(yaml).getSerializationConfig();
        assertThatThrownBy(() -> CompactTestUtil.verifySerializationServiceBuilds(config))
                .isInstanceOf(InvalidConfigurationException.class)
                .hasMessageContaining("Cannot create an instance");
    }

    @Override
    public void testCompactSerialization_withInvalidCompactSerializableClass() {
        String yaml = """
                hazelcast:
                    serialization:
                        compact-serialization:
                            classes:
                                - class: does.not.exist.Foo
                """;

        SerializationConfig config = buildConfig(yaml).getSerializationConfig();
        assertThatThrownBy(() -> CompactTestUtil.verifySerializationServiceBuilds(config))
                .isInstanceOf(InvalidConfigurationException.class)
                .hasMessageContaining("Cannot load");
    }

    @Override
    @Test
    public void testAllowOverrideDefaultSerializers() {
        final String yaml = """
                hazelcast:
                  serialization:
                    allow-override-default-serializers: true
                """;

        final Config config = new InMemoryYamlConfig(yaml);
        final boolean isAllowOverrideDefaultSerializers
                = config.getSerializationConfig().isAllowOverrideDefaultSerializers();
        assertTrue(isAllowOverrideDefaultSerializers);
    }

    @Override
    @Test
    public void testHotRestart() {
        String dir = "/mnt/hot-restart-root/";
        String backupDir = "/mnt/hot-restart-backup/";
        int parallelism = 3;
        int validationTimeout = 13131;
        int dataLoadTimeout = 45454;
        HotRestartClusterDataRecoveryPolicy policy = HotRestartClusterDataRecoveryPolicy.PARTIAL_RECOVERY_MOST_RECENT;
        String yaml = ""
                + "hazelcast:\n"
                + "  hot-restart-persistence:\n"
                + "    auto-remove-stale-data: true\n"
                + "    enabled: true\n"
                + "    base-dir: " + dir + "\n"
                + "    backup-dir: " + backupDir + "\n"
                + "    parallelism: " + parallelism + "\n"
                + "    validation-timeout-seconds: " + validationTimeout + "\n"
                + "    data-load-timeout-seconds: " + dataLoadTimeout + "\n"
                + "    cluster-data-recovery-policy: " + policy + "\n";

        Config config = new InMemoryYamlConfig(yaml);
        HotRestartPersistenceConfig hotRestartPersistenceConfig = config.getHotRestartPersistenceConfig();

        assertTrue(hotRestartPersistenceConfig.isEnabled());
        assertTrue(hotRestartPersistenceConfig.isAutoRemoveStaleData());
        assertEquals(new File(dir).getAbsolutePath(), hotRestartPersistenceConfig.getBaseDir().getAbsolutePath());
        assertEquals(new File(backupDir).getAbsolutePath(), hotRestartPersistenceConfig.getBackupDir().getAbsolutePath());
        assertEquals(parallelism, hotRestartPersistenceConfig.getParallelism());
        assertEquals(validationTimeout, hotRestartPersistenceConfig.getValidationTimeoutSeconds());
        assertEquals(dataLoadTimeout, hotRestartPersistenceConfig.getDataLoadTimeoutSeconds());
        assertEquals(policy, hotRestartPersistenceConfig.getClusterDataRecoveryPolicy());
    }

    @Override
    @Test
    public void testPersistence() {
        String dir = "/mnt/persistence-root/";
        String backupDir = "/mnt/persistence-backup/";
        int parallelism = 3;
        int validationTimeout = 13131;
        int dataLoadTimeout = 45454;
        int rebalanceDelaySeconds = 240;
        PersistenceClusterDataRecoveryPolicy policy = PersistenceClusterDataRecoveryPolicy.PARTIAL_RECOVERY_MOST_RECENT;
        String yaml = ""
                + "hazelcast:\n"
                + "  persistence:\n"
                + "    enabled: true\n"
                + "    auto-remove-stale-data: true\n"
                + "    base-dir: " + dir + "\n"
                + "    backup-dir: " + backupDir + "\n"
                + "    parallelism: " + parallelism + "\n"
                + "    validation-timeout-seconds: " + validationTimeout + "\n"
                + "    data-load-timeout-seconds: " + dataLoadTimeout + "\n"
                + "    cluster-data-recovery-policy: " + policy + "\n"
                + "    rebalance-delay-seconds: " + rebalanceDelaySeconds + "\n";

        Config config = new InMemoryYamlConfig(yaml);
        PersistenceConfig persistenceConfig = config.getPersistenceConfig();

        assertTrue(persistenceConfig.isEnabled());
        assertTrue(persistenceConfig.isAutoRemoveStaleData());
        assertEquals(new File(dir).getAbsolutePath(), persistenceConfig.getBaseDir().getAbsolutePath());
        assertEquals(new File(backupDir).getAbsolutePath(), persistenceConfig.getBackupDir().getAbsolutePath());
        assertEquals(parallelism, persistenceConfig.getParallelism());
        assertEquals(validationTimeout, persistenceConfig.getValidationTimeoutSeconds());
        assertEquals(dataLoadTimeout, persistenceConfig.getDataLoadTimeoutSeconds());
        assertEquals(policy, persistenceConfig.getClusterDataRecoveryPolicy());
        assertEquals(rebalanceDelaySeconds, persistenceConfig.getRebalanceDelaySeconds());
    }

    @Override
    @Test
    public void testDynamicConfig() {
        boolean persistenceEnabled = true;
        String backupDir = "/mnt/dynamic-configuration/backup-dir";
        int backupCount = 7;

        String yaml = ""
                + "hazelcast:\n"
                + "  dynamic-configuration:\n"
                + "    persistence-enabled: " + persistenceEnabled + "\n"
                + "    backup-dir: " + backupDir + "\n"
                + "    backup-count: " + backupCount + "\n";

        Config config = new InMemoryYamlConfig(yaml);
        DynamicConfigurationConfig dynamicConfigurationConfig = config.getDynamicConfigurationConfig();

        assertEquals(persistenceEnabled, dynamicConfigurationConfig.isPersistenceEnabled());
        assertEquals(new File(backupDir).getAbsolutePath(), dynamicConfigurationConfig.getBackupDir().getAbsolutePath());
        assertEquals(backupCount, dynamicConfigurationConfig.getBackupCount());

        yaml = ""
                + "hazelcast:\n"
                + "  dynamic-configuration:\n"
                + "    persistence-enabled: " + persistenceEnabled + "\n";

        config = new InMemoryYamlConfig(yaml);
        dynamicConfigurationConfig = config.getDynamicConfigurationConfig();

        assertEquals(persistenceEnabled, dynamicConfigurationConfig.isPersistenceEnabled());
        assertEquals(new File(DEFAULT_BACKUP_DIR).getAbsolutePath(), dynamicConfigurationConfig.getBackupDir().getAbsolutePath());
        assertEquals(DEFAULT_BACKUP_COUNT, dynamicConfigurationConfig.getBackupCount());
    }

    @Override
    @Test
    public void testLocalDevice() {
        String baseDir = "base-directory";
        int blockSize = 2048;
        int readIOThreadCount = 16;
        int writeIOThreadCount = 1;

        String yaml =  ""
                + "hazelcast:\n";
        Config config = new InMemoryYamlConfig(yaml);

        // default device
        LocalDeviceConfig localDeviceConfig = config.getDeviceConfig(DEFAULT_DEVICE_NAME);
        assertEquals(DEFAULT_DEVICE_NAME, localDeviceConfig.getName());
        assertEquals(new File(DEFAULT_DEVICE_BASE_DIR).getAbsoluteFile(), localDeviceConfig.getBaseDir());
        assertEquals(DEFAULT_BLOCK_SIZE_IN_BYTES, localDeviceConfig.getBlockSize());
        assertEquals(DEFAULT_READ_IO_THREAD_COUNT, localDeviceConfig.getReadIOThreadCount());
        assertEquals(DEFAULT_WRITE_IO_THREAD_COUNT, localDeviceConfig.getWriteIOThreadCount());
        assertEquals(LocalDeviceConfig.DEFAULT_CAPACITY, localDeviceConfig.getCapacity());



        yaml = ""
                + "hazelcast:\n"
                + "  local-device:\n"
                + "    my-device:\n"
                + "      base-dir: " + baseDir + "\n"
                + "      capacity:\n"
                + "        unit: GIGABYTES\n"
                + "        value: 100\n"
                + "      block-size: " + blockSize + "\n"
                + "      read-io-thread-count: " + readIOThreadCount + "\n"
                + "      write-io-thread-count: " + writeIOThreadCount + "\n";

        config = new InMemoryYamlConfig(yaml);
        localDeviceConfig = config.getDeviceConfig("my-device");

        assertEquals("my-device", localDeviceConfig.getName());
        assertEquals(new File(baseDir).getAbsolutePath(), localDeviceConfig.getBaseDir().getAbsolutePath());
        assertEquals(blockSize, localDeviceConfig.getBlockSize());
        assertEquals(new Capacity(100, MemoryUnit.GIGABYTES), localDeviceConfig.getCapacity());
        assertEquals(readIOThreadCount, localDeviceConfig.getReadIOThreadCount());
        assertEquals(writeIOThreadCount, localDeviceConfig.getWriteIOThreadCount());

        int device0Multiplier = 2;
        int device1Multiplier = 4;
        yaml = ""
                + "hazelcast:\n"
                + "  local-device:\n"
                + "    device0:\n"
                + "      capacity:\n"
                + "        unit: MEGABYTES\n"
                + "        value: 1234567890\n"
                + "      block-size: " + (blockSize * device0Multiplier) + "\n"
                + "      read-io-thread-count: " + (readIOThreadCount * device0Multiplier) + "\n"
                + "      write-io-thread-count: " + (writeIOThreadCount * device0Multiplier) + "\n"
                + "    device1:\n"
                + "      block-size: " + (blockSize * device1Multiplier) + "\n"
                + "      read-io-thread-count: " + (readIOThreadCount * device1Multiplier) + "\n"
                + "      write-io-thread-count: " + (writeIOThreadCount * device1Multiplier) + "\n";

        config = new InMemoryYamlConfig(yaml);
        // default device is removed.
        assertEquals(2, config.getDeviceConfigs().size());
        assertNull(config.getDeviceConfig(DEFAULT_DEVICE_NAME));

        localDeviceConfig = config.getDeviceConfig("device0");
        assertEquals(blockSize * device0Multiplier, localDeviceConfig.getBlockSize());
        assertEquals(readIOThreadCount * device0Multiplier, localDeviceConfig.getReadIOThreadCount());
        assertEquals(writeIOThreadCount * device0Multiplier, localDeviceConfig.getWriteIOThreadCount());
        assertEquals(new Capacity(1234567890, MemoryUnit.MEGABYTES), localDeviceConfig.getCapacity());

        localDeviceConfig = config.getDeviceConfig("device1");
        assertEquals(blockSize * device1Multiplier, localDeviceConfig.getBlockSize());
        assertEquals(readIOThreadCount * device1Multiplier, localDeviceConfig.getReadIOThreadCount());
        assertEquals(writeIOThreadCount * device1Multiplier, localDeviceConfig.getWriteIOThreadCount());

        // override the default device config
        String newBaseDir = "/some/random/base/dir/for/tiered/store";
        yaml = ""
                + "hazelcast:\n"
                + "  local-device:\n"
                + "    " + DEFAULT_DEVICE_NAME + ":\n"
                + "      base-dir: " + newBaseDir + "\n"
                + "      block-size: " + (DEFAULT_BLOCK_SIZE_IN_BYTES * 2) + "\n"
                + "      read-io-thread-count: " + (DEFAULT_READ_IO_THREAD_COUNT * 2) + "\n";

        config = new InMemoryYamlConfig(yaml);
        assertEquals(1, config.getDeviceConfigs().size());

        localDeviceConfig = config.getDeviceConfig(DEFAULT_DEVICE_NAME);
        assertEquals(DEFAULT_DEVICE_NAME, localDeviceConfig.getName());
        assertEquals(new File(newBaseDir).getAbsoluteFile(), localDeviceConfig.getBaseDir());
        assertEquals(2 * DEFAULT_BLOCK_SIZE_IN_BYTES, localDeviceConfig.getBlockSize());
        assertEquals(2 * DEFAULT_READ_IO_THREAD_COUNT, localDeviceConfig.getReadIOThreadCount());
        assertEquals(DEFAULT_WRITE_IO_THREAD_COUNT, localDeviceConfig.getWriteIOThreadCount());
    }

    @Override
    @Test
    public void testTieredStore() {
        String yaml = """
                hazelcast:
                  map:
                    map0:
                      tiered-store:
                        enabled: true
                        memory-tier:
                          capacity:
                            unit: MEGABYTES
                            value: 1024
                        disk-tier:
                          enabled: true
                          device-name: local-device
                    map1:
                      tiered-store:
                        enabled: true
                        disk-tier:
                          enabled: true
                    map2:
                      tiered-store:
                        enabled: true
                        memory-tier:
                          capacity:
                            unit: GIGABYTES
                            value: 1
                    map3:
                      tiered-store:
                        enabled: true
                """;

        Config config = new InMemoryYamlConfig(yaml);
        TieredStoreConfig tieredStoreConfig = config.getMapConfig("map0").getTieredStoreConfig();
        assertTrue(tieredStoreConfig.isEnabled());

        MemoryTierConfig memoryTierConfig = tieredStoreConfig.getMemoryTierConfig();
        assertEquals(MemoryUnit.MEGABYTES, memoryTierConfig.getCapacity().getUnit());
        assertEquals(1024, memoryTierConfig.getCapacity().getValue());

        DiskTierConfig diskTierConfig = tieredStoreConfig.getDiskTierConfig();
        assertTrue(tieredStoreConfig.getDiskTierConfig().isEnabled());
        assertEquals("local-device", diskTierConfig.getDeviceName());

        assertEquals(DEFAULT_DEVICE_NAME,
                config.getMapConfig("map1").getTieredStoreConfig().getDiskTierConfig().getDeviceName());
        assertNotNull(config.getDeviceConfig(DEFAULT_DEVICE_NAME));

        tieredStoreConfig = config.getMapConfig("map2").getTieredStoreConfig();
        assertTrue(tieredStoreConfig.isEnabled());

        memoryTierConfig = tieredStoreConfig.getMemoryTierConfig();
        assertEquals(MemoryUnit.GIGABYTES, memoryTierConfig.getCapacity().getUnit());
        assertEquals(1L, memoryTierConfig.getCapacity().getValue());

        assertFalse(tieredStoreConfig.getDiskTierConfig().isEnabled());

        tieredStoreConfig = config.getMapConfig("map3").getTieredStoreConfig();
        memoryTierConfig = tieredStoreConfig.getMemoryTierConfig();
        assertEquals(DEFAULT_CAPACITY, memoryTierConfig.getCapacity());

        diskTierConfig = tieredStoreConfig.getDiskTierConfig();
        assertFalse(diskTierConfig.isEnabled());
        assertEquals(DEFAULT_DEVICE_NAME, diskTierConfig.getDeviceName());

        yaml = """
                hazelcast:
                  map:
                    some-map:
                      tiered-store:
                        enabled: true
                """;

        config = new InMemoryYamlConfig(yaml);
        assertEquals(1, config.getDeviceConfigs().size());
        assertEquals(1, config.getDeviceConfigs().size());
        assertEquals(new LocalDeviceConfig(), config.getDeviceConfig(DEFAULT_DEVICE_NAME));
        assertEquals(DEFAULT_DEVICE_NAME,
                config.getMapConfig("some-map").getTieredStoreConfig().getDiskTierConfig().getDeviceName());
    }

    @Override
    @Test
    public void testHotRestartEncryptionAtRest_whenJavaKeyStore() {
        int keySize = 16;
        String keyStorePath = "/tmp/keystore.p12";
        String keyStoreType = "PKCS12";
        String keyStorePassword = "password";
        int pollingInterval = 60;
        String currentKeyAlias = "current";
        String yaml = ""
                + "hazelcast:\n"
                + "  hot-restart-persistence:\n"
                + "    enabled: true\n"
                + "    encryption-at-rest:\n"
                + "      enabled: true\n"
                + "      algorithm: AES\n"
                + "      salt: some-salt\n"
                + "      key-size: " + keySize + "\n"
                + "      secure-store:\n"
                + "        keystore:\n"
                + "          path: " + keyStorePath + "\n"
                + "          type: " + keyStoreType + "\n"
                + "          password: " + keyStorePassword + "\n"
                + "          polling-interval: " + pollingInterval + "\n"
                + "          current-key-alias: " + currentKeyAlias + "\n";

        Config config = new InMemoryYamlConfig(yaml);
        HotRestartPersistenceConfig hotRestartPersistenceConfig = config.getHotRestartPersistenceConfig();
        assertTrue(hotRestartPersistenceConfig.isEnabled());

        EncryptionAtRestConfig encryptionAtRestConfig = hotRestartPersistenceConfig.getEncryptionAtRestConfig();
        assertTrue(encryptionAtRestConfig.isEnabled());
        assertEquals("AES", encryptionAtRestConfig.getAlgorithm());
        assertEquals("some-salt", encryptionAtRestConfig.getSalt());
        assertEquals(keySize, encryptionAtRestConfig.getKeySize());
        SecureStoreConfig secureStoreConfig = encryptionAtRestConfig.getSecureStoreConfig();
        assertTrue(secureStoreConfig instanceof JavaKeyStoreSecureStoreConfig);
        JavaKeyStoreSecureStoreConfig keyStoreConfig = (JavaKeyStoreSecureStoreConfig) secureStoreConfig;
        assertEquals(new File(keyStorePath).getAbsolutePath(), keyStoreConfig.getPath().getAbsolutePath());
        assertEquals(keyStoreType, keyStoreConfig.getType());
        assertEquals(keyStorePassword, keyStoreConfig.getPassword());
        assertEquals(pollingInterval, keyStoreConfig.getPollingInterval());
        assertEquals(currentKeyAlias, keyStoreConfig.getCurrentKeyAlias());
    }

    @Override
    @Test
    public void testPersistenceEncryptionAtRest_whenJavaKeyStore() {
        int keySize = 16;
        String keyStorePath = "/tmp/keystore.p12";
        String keyStoreType = "PKCS12";
        String keyStorePassword = "password";
        int pollingInterval = 60;
        String currentKeyAlias = "current";
        String yaml = ""
                + "hazelcast:\n"
                + "  persistence:\n"
                + "    enabled: true\n"
                + "    encryption-at-rest:\n"
                + "      enabled: true\n"
                + "      algorithm: AES\n"
                + "      salt: some-salt\n"
                + "      key-size: " + keySize + "\n"
                + "      secure-store:\n"
                + "        keystore:\n"
                + "          path: " + keyStorePath + "\n"
                + "          type: " + keyStoreType + "\n"
                + "          password: " + keyStorePassword + "\n"
                + "          polling-interval: " + pollingInterval + "\n"
                + "          current-key-alias: " + currentKeyAlias + "\n";

        Config config = new InMemoryYamlConfig(yaml);
        PersistenceConfig persistenceConfig = config.getPersistenceConfig();
        assertTrue(persistenceConfig.isEnabled());

        EncryptionAtRestConfig encryptionAtRestConfig = persistenceConfig.getEncryptionAtRestConfig();
        assertTrue(encryptionAtRestConfig.isEnabled());
        assertEquals("AES", encryptionAtRestConfig.getAlgorithm());
        assertEquals("some-salt", encryptionAtRestConfig.getSalt());
        assertEquals(keySize, encryptionAtRestConfig.getKeySize());
        SecureStoreConfig secureStoreConfig = encryptionAtRestConfig.getSecureStoreConfig();
        assertTrue(secureStoreConfig instanceof JavaKeyStoreSecureStoreConfig);
        JavaKeyStoreSecureStoreConfig keyStoreConfig = (JavaKeyStoreSecureStoreConfig) secureStoreConfig;
        assertEquals(new File(keyStorePath).getAbsolutePath(), keyStoreConfig.getPath().getAbsolutePath());
        assertEquals(keyStoreType, keyStoreConfig.getType());
        assertEquals(keyStorePassword, keyStoreConfig.getPassword());
        assertEquals(pollingInterval, keyStoreConfig.getPollingInterval());
        assertEquals(currentKeyAlias, keyStoreConfig.getCurrentKeyAlias());
    }

    @Override
    @Test
    public void testHotRestartEncryptionAtRest_whenVault() {
        int keySize = 16;
        String address = "https://localhost:1234";
        String secretPath = "secret/path";
        String token = "token";
        int pollingInterval = 60;
        String yaml = ""
                + "hazelcast:\n"
                + "  hot-restart-persistence:\n"
                + "    enabled: true\n"
                + "    encryption-at-rest:\n"
                + "      enabled: true\n"
                + "      algorithm: AES\n"
                + "      salt: some-salt\n"
                + "      key-size: " + keySize + "\n"
                + "      secure-store:\n"
                + "        vault:\n"
                + "          address: " + address + "\n"
                + "          secret-path: " + secretPath + "\n"
                + "          token: " + token + "\n"
                + "          polling-interval: " + pollingInterval + "\n"
                + "          ssl:\n"
                + "            enabled: true\n"
                + "            factory-class-name: com.hazelcast.nio.ssl.BasicSSLContextFactory\n"
                + "            properties:\n"
                + "              protocol: TLS\n";

        Config config = new InMemoryYamlConfig(yaml);
        HotRestartPersistenceConfig hotRestartPersistenceConfig = config.getHotRestartPersistenceConfig();
        assertTrue(hotRestartPersistenceConfig.isEnabled());

        EncryptionAtRestConfig encryptionAtRestConfig = hotRestartPersistenceConfig.getEncryptionAtRestConfig();
        assertTrue(encryptionAtRestConfig.isEnabled());
        assertEquals("AES", encryptionAtRestConfig.getAlgorithm());
        assertEquals("some-salt", encryptionAtRestConfig.getSalt());
        assertEquals(keySize, encryptionAtRestConfig.getKeySize());
        SecureStoreConfig secureStoreConfig = encryptionAtRestConfig.getSecureStoreConfig();
        assertTrue(secureStoreConfig instanceof VaultSecureStoreConfig);
        VaultSecureStoreConfig vaultConfig = (VaultSecureStoreConfig) secureStoreConfig;
        assertEquals(address, vaultConfig.getAddress());
        assertEquals(secretPath, vaultConfig.getSecretPath());
        assertEquals(token, vaultConfig.getToken());
        assertEquals(pollingInterval, vaultConfig.getPollingInterval());
        SSLConfig sslConfig = vaultConfig.getSSLConfig();
        assertTrue(sslConfig.isEnabled());
        assertEquals("com.hazelcast.nio.ssl.BasicSSLContextFactory", sslConfig.getFactoryClassName());
        assertEquals(1, sslConfig.getProperties().size());
        assertEquals("TLS", sslConfig.getProperties().get("protocol"));
    }

    @Override
    @Test
    public void testPersistenceEncryptionAtRest_whenVault() {
        int keySize = 16;
        String address = "https://localhost:1234";
        String secretPath = "secret/path";
        String token = "token";
        int pollingInterval = 60;
        String yaml = ""
                + "hazelcast:\n"
                + "  persistence:\n"
                + "    enabled: true\n"
                + "    encryption-at-rest:\n"
                + "      enabled: true\n"
                + "      algorithm: AES\n"
                + "      salt: some-salt\n"
                + "      key-size: " + keySize + "\n"
                + "      secure-store:\n"
                + "        vault:\n"
                + "          address: " + address + "\n"
                + "          secret-path: " + secretPath + "\n"
                + "          token: " + token + "\n"
                + "          polling-interval: " + pollingInterval + "\n"
                + "          ssl:\n"
                + "            enabled: true\n"
                + "            factory-class-name: com.hazelcast.nio.ssl.BasicSSLContextFactory\n"
                + "            properties:\n"
                + "              protocol: TLS\n";

        Config config = new InMemoryYamlConfig(yaml);
        PersistenceConfig persistenceConfig = config.getPersistenceConfig();
        assertTrue(persistenceConfig.isEnabled());

        EncryptionAtRestConfig encryptionAtRestConfig = persistenceConfig.getEncryptionAtRestConfig();
        assertTrue(encryptionAtRestConfig.isEnabled());
        assertEquals("AES", encryptionAtRestConfig.getAlgorithm());
        assertEquals("some-salt", encryptionAtRestConfig.getSalt());
        assertEquals(keySize, encryptionAtRestConfig.getKeySize());
        SecureStoreConfig secureStoreConfig = encryptionAtRestConfig.getSecureStoreConfig();
        assertTrue(secureStoreConfig instanceof VaultSecureStoreConfig);
        VaultSecureStoreConfig vaultConfig = (VaultSecureStoreConfig) secureStoreConfig;
        assertEquals(address, vaultConfig.getAddress());
        assertEquals(secretPath, vaultConfig.getSecretPath());
        assertEquals(token, vaultConfig.getToken());
        assertEquals(pollingInterval, vaultConfig.getPollingInterval());
        SSLConfig sslConfig = vaultConfig.getSSLConfig();
        assertTrue(sslConfig.isEnabled());
        assertEquals("com.hazelcast.nio.ssl.BasicSSLContextFactory", sslConfig.getFactoryClassName());
        assertEquals(1, sslConfig.getProperties().size());
        assertEquals("TLS", sslConfig.getProperties().get("protocol"));
    }

    @Override
    @Test
    public void testCachePermission() {
        String yaml = """
                hazelcast:
                  security:
                    enabled: true
                    client-permissions:
                      cache:
                        - name: /hz/cachemanager1/cache1
                          principal: dev
                          actions:
                            - create
                            - destroy
                            - add
                            - remove
                """;

        Config config = buildConfig(yaml);
        PermissionConfig expected = new PermissionConfig(CACHE, "/hz/cachemanager1/cache1", "dev");
        expected.addAction("create").addAction("destroy").addAction("add").addAction("remove");
        assertPermissionConfig(expected, config);
    }

    @Override
    @Test
    public void testOnJoinPermissionOperation() {
        for (OnJoinPermissionOperationName onJoinOp : OnJoinPermissionOperationName.values()) {
            String yaml = ""
                    + "hazelcast:\n"
                    + "  security:\n"
                    + "    client-permissions:\n"
                    + "      on-join-operation: " + onJoinOp.name();
            Config config = buildConfig(yaml);
            assertSame(onJoinOp, config.getSecurityConfig().getOnJoinPermissionOperation());
        }
    }

    @Override
    @Test
    public void testConfigPermission() {
        String yaml = """
                hazelcast:
                  security:
                    enabled: true
                    client-permissions:
                      priority-grant: true
                      config:
                        deny: true
                        principal: dev
                        endpoints:
                          - 127.0.0.1""";

        Config config = buildConfig(yaml);
        PermissionConfig expected = new PermissionConfig(CONFIG, null, "dev").setDeny(true);
        expected.getEndpoints().add("127.0.0.1");
        assertPermissionConfig(expected, config);
        assertTrue(config.getSecurityConfig().isPermissionPriorityGrant());
    }

    @Override
    @Test(expected = InvalidConfigurationException.class)
    public void testCacheConfig_withNativeInMemoryFormat_failsFastInOSS() {
        String yaml = """
                hazelcast:
                  cache:
                    cache:
                      eviction:
                        size: 10000000
                        max-size-policy: ENTRY_COUNT
                        eviction-policy: LFU
                      in-memory-format: NATIVE
                """;

        buildConfig(yaml);
    }

    @Override
    @Test
    public void testAllPermissionsCovered() throws IOException {
        URL yamlResource = YamlConfigBuilderTest.class.getClassLoader().getResource("hazelcast-fullconfig.yaml");
        Config config = new YamlConfigBuilder(yamlResource).build();
        Set<PermissionType> allPermissionTypes = Set.of(PermissionType.values());
        Set<PermissionType> foundPermissionTypes = config.getSecurityConfig().getClientPermissionConfigs().stream()
                .map(PermissionConfig::getType).collect(Collectors.toSet());
        Collection<PermissionType> difference = Sets.difference(allPermissionTypes, foundPermissionTypes);

        assertTrue(String.format("All permission types should be listed in %s. Not found ones: %s", yamlResource, difference),
                difference.isEmpty());
    }

    @Override
    @Test(expected = InvalidConfigurationException.class)
    @Ignore("Schema validation is supposed to fail with missing mandatory field: class-name")
    public void testMemberAddressProvider_classNameIsMandatory() {
        String yaml = """
                hazelcast:
                  network:
                    member-address-provider:
                      enabled: true
                """;

        buildConfig(yaml);
    }

    @Override
    @Test
    public void testMemberAddressProviderEnabled() {
        String yaml = """
                hazelcast:
                  network:
                    member-address-provider:
                      enabled: true
                      class-name: foo.bar.Clazz
                """;

        Config config = buildConfig(yaml);
        MemberAddressProviderConfig memberAddressProviderConfig = config.getNetworkConfig().getMemberAddressProviderConfig();

        assertTrue(memberAddressProviderConfig.isEnabled());
        assertEquals("foo.bar.Clazz", memberAddressProviderConfig.getClassName());
    }

    @Override
    @Test
    public void testMemberAddressProviderEnabled_withProperties() {
        String yaml = """
                hazelcast:
                  network:
                    member-address-provider:
                      enabled: true
                      class-name: foo.bar.Clazz
                      properties:
                        propName1: propValue1
                """;

        Config config = buildConfig(yaml);
        MemberAddressProviderConfig memberAddressProviderConfig = config.getNetworkConfig().getMemberAddressProviderConfig();

        Properties properties = memberAddressProviderConfig.getProperties();
        assertEquals(1, properties.size());
        assertEquals("propValue1", properties.get("propName1"));
    }

    @Override
    @Test
    public void testFailureDetector_withProperties() {
        String yaml = """
                hazelcast:
                  network:
                    failure-detector:
                      icmp:
                        enabled: true
                        timeout-milliseconds: 42
                        fail-fast-on-startup: true
                        interval-milliseconds: 4200
                        max-attempts: 42
                        parallel-mode: true
                        ttl: 255
                """;

        Config config = buildConfig(yaml);
        NetworkConfig networkConfig = config.getNetworkConfig();
        IcmpFailureDetectorConfig icmpFailureDetectorConfig = networkConfig.getIcmpFailureDetectorConfig();
        assertNotNull(icmpFailureDetectorConfig);

        assertTrue(icmpFailureDetectorConfig.isEnabled());
        assertTrue(icmpFailureDetectorConfig.isParallelMode());
        assertTrue(icmpFailureDetectorConfig.isFailFastOnStartup());
        assertEquals(42, icmpFailureDetectorConfig.getTimeoutMilliseconds());
        assertEquals(42, icmpFailureDetectorConfig.getMaxAttempts());
        assertEquals(4200, icmpFailureDetectorConfig.getIntervalMilliseconds());
    }

    @Override
    @Test
    public void testHandleMemberAttributes() {
        String yaml = """
                hazelcast:
                  member-attributes:
                    IDENTIFIER:
                      type: string
                      value: ID
                """;

        Config config = buildConfig(yaml);
        MemberAttributeConfig memberAttributeConfig = config.getMemberAttributeConfig();
        assertNotNull(memberAttributeConfig);
        assertEquals("ID", memberAttributeConfig.getAttribute("IDENTIFIER"));
    }

    @Override
    @Test
    public void testMemcacheProtocolEnabled() {
        String yaml = """
                hazelcast:
                  network:
                    memcache-protocol:
                      enabled: true
                """;
        Config config = buildConfig(yaml);
        MemcacheProtocolConfig memcacheProtocolConfig = config.getNetworkConfig().getMemcacheProtocolConfig();
        assertNotNull(memcacheProtocolConfig);
        assertTrue(memcacheProtocolConfig.isEnabled());
    }

    @Override
    @Test
    public void testRestApiDefaults() {
        String yaml = """
                hazelcast:
                  network:
                    rest-api:
                      enabled: false""";
        Config config = buildConfig(yaml);
        RestApiConfig restApiConfig = config.getNetworkConfig().getRestApiConfig();
        assertNotNull(restApiConfig);
        assertFalse(restApiConfig.isEnabled());
        for (RestEndpointGroup group : RestEndpointGroup.values()) {
            assertEquals("Unexpected status of group " + group, group.isEnabledByDefault(),
                    restApiConfig.isGroupEnabled(group));
        }
    }

    @Override
    @Test
    public void testRestApiEndpointGroups() {
        String yaml = """
                hazelcast:
                  network:
                    rest-api:
                      enabled: true
                      endpoint-groups:
                        HEALTH_CHECK:
                          enabled: true
                        DATA:
                          enabled: true
                        CLUSTER_READ:
                          enabled: false""";
        Config config = buildConfig(yaml);
        RestApiConfig restApiConfig = config.getNetworkConfig().getRestApiConfig();
        assertTrue(restApiConfig.isEnabled());
        assertTrue(restApiConfig.isGroupEnabled(RestEndpointGroup.HEALTH_CHECK));
        assertFalse(restApiConfig.isGroupEnabled(RestEndpointGroup.CLUSTER_READ));
        assertEquals(RestEndpointGroup.CLUSTER_WRITE.isEnabledByDefault(),
                restApiConfig.isGroupEnabled(RestEndpointGroup.CLUSTER_WRITE));

    }

    @Override
    @Test(expected = InvalidConfigurationException.class)
    public void testUnknownRestApiEndpointGroup() {
        String yaml = """
                hazelcast:
                  network:
                    rest-api:
                      enabled: true
                      endpoint-groups:
                        TEST:
                          enabled: true""";
        buildConfig(yaml);
    }

    @Override
    @Test
    public void testDefaultAdvancedNetworkConfig() {
        String yaml = """
                hazelcast:
                  advanced-network: {}
                """;

        Config config = buildConfig(yaml);
        AdvancedNetworkConfig advancedNetworkConfig = config.getAdvancedNetworkConfig();
        JoinConfig joinConfig = advancedNetworkConfig.getJoin();
        IcmpFailureDetectorConfig fdConfig = advancedNetworkConfig.getIcmpFailureDetectorConfig();
        MemberAddressProviderConfig providerConfig = advancedNetworkConfig.getMemberAddressProviderConfig();

        assertFalse(advancedNetworkConfig.isEnabled());
        assertTrue(joinConfig.getAutoDetectionConfig().isEnabled());
        assertNull(fdConfig);
        assertFalse(providerConfig.isEnabled());

        assertTrue(advancedNetworkConfig.getEndpointConfigs().containsKey(EndpointQualifier.MEMBER));
        assertEquals(1, advancedNetworkConfig.getEndpointConfigs().size());
    }

    @Override
    @Test
    public void testAdvancedNetworkConfig_whenInvalidSocketKeepIdleSeconds() {
        String invalid1 = getAdvancedNetworkConfigWithSocketOption("keep-idle-seconds", -1);
        Assert.assertThrows(IllegalArgumentException.class, () -> buildConfig(invalid1));

        String invalid2 = getAdvancedNetworkConfigWithSocketOption("keep-idle-seconds", 0);
        Assert.assertThrows(IllegalArgumentException.class, () -> buildConfig(invalid2));

        String invalid3 = getAdvancedNetworkConfigWithSocketOption("keep-idle-seconds", 32768);
        Assert.assertThrows(IllegalArgumentException.class, () -> buildConfig(invalid3));
    }

    @Override
    @Test
    public void testAdvancedNetworkConfig_whenInvalidSocketKeepIntervalSeconds() {
        String invalid1 = getAdvancedNetworkConfigWithSocketOption("keep-interval-seconds", -1);
        Assert.assertThrows(IllegalArgumentException.class, () -> buildConfig(invalid1));

        String invalid2 = getAdvancedNetworkConfigWithSocketOption("keep-interval-seconds", 0);
        Assert.assertThrows(IllegalArgumentException.class, () -> buildConfig(invalid2));

        String invalid3 = getAdvancedNetworkConfigWithSocketOption("keep-interval-seconds", 32768);
        Assert.assertThrows(IllegalArgumentException.class, () -> buildConfig(invalid3));
    }

    @Override
    @Test
    public void testAdvancedNetworkConfig_whenInvalidSocketKeepCount() {
        String invalid1 = getAdvancedNetworkConfigWithSocketOption("keep-count", -1);
        Assert.assertThrows(IllegalArgumentException.class, () -> buildConfig(invalid1));

        String invalid2 = getAdvancedNetworkConfigWithSocketOption("keep-count", 0);
        Assert.assertThrows(IllegalArgumentException.class, () -> buildConfig(invalid2));

        String invalid3 = getAdvancedNetworkConfigWithSocketOption("keep-count", 128);
        Assert.assertThrows(IllegalArgumentException.class, () -> buildConfig(invalid3));
    }

    @Override
    @Test
    public void testAmbiguousNetworkConfig_throwsException() {
        String yaml = """
                hazelcast:
                  advanced-network:
                    enabled: true
                  network:
                    port: 9999""";

        expected.expect(InvalidConfigurationException.class);
        buildConfig(yaml);
    }

    @Override
    @Test
    public void testNetworkConfigUnambiguous_whenAdvancedNetworkDisabled() {
        String yaml = """
                hazelcast:
                  advanced-network: {}
                  network:
                    port:
                      port: 9999
                """;

        Config config = buildConfig(yaml);
        assertFalse(config.getAdvancedNetworkConfig().isEnabled());
        assertEquals(9999, config.getNetworkConfig().getPort());
    }

    @Override
    @Test
    public void testMultipleMemberEndpointConfigs_throwsException() {
        String yaml = """
                hazelcast:
                advanced-network:
                  member-server-socket-endpoint-config: {}
                  member-server-socket-endpoint-config: {}""";

        expected.expect(InvalidConfigurationException.class);
        buildConfig(yaml);

    }

    @Test
    public void outboundPorts_asObject_ParsingTest() {
        String yaml = """
                hazelcast:
                  network:
                    outbound-ports:
                      ports: 2500-3000
                      more-ports: 2600-3500
                """;
        Config actual = buildConfig(yaml);
        assertEquals(new HashSet<>(asList("2500-3000", "2600-3500")), actual.getNetworkConfig().getOutboundPortDefinitions());
    }

    @Test
    public void outboundPorts_asSequence_ParsingTest() {
        String yaml = """
                hazelcast:
                  network:
                    outbound-ports:
                      - 1234-1999
                      - 2500
                """;
        Config actual = buildConfig(yaml);
        assertEquals(new HashSet<>(asList("2500", "1234-1999")), actual.getNetworkConfig().getOutboundPortDefinitions());
    }

    @Override
    protected Config buildCompleteAdvancedNetworkConfig() {
        String yaml = """
                hazelcast:
                  advanced-network:
                    enabled: true
                    join:
                      multicast:
                        enabled: false
                      tcp-ip:
                        enabled: true
                        required-member: 10.10.1.10
                        member-list:
                          - 10.10.1.11
                          - 10.10.1.12
                    failure-detector:
                      icmp:
                        enabled: true
                        timeout-milliseconds: 42
                        fail-fast-on-startup: true
                        interval-milliseconds: 4200
                        max-attempts: 42
                        parallel-mode: true
                        ttl: 255
                    member-address-provider:
                      class-name: com.hazelcast.test.Provider
                    member-server-socket-endpoint-config:
                      name: member-server-socket
                      outbound-ports:
                        ports: 33000-33100
                      interfaces:
                        enabled: true
                        interfaces:
                          - 10.10.0.1
                      ssl:
                        enabled: true
                        factory-class-name: com.hazelcast.examples.MySSLContextFactory
                        properties:
                          foo: bar
                      socket-interceptor:
                        enabled: true
                        class-name: com.hazelcast.examples.MySocketInterceptor
                        properties:
                          foo: baz
                      socket-options:
                        buffer-direct: true
                        tcp-no-delay: true
                        keep-alive: true
                        connect-timeout-seconds: 33
                        send-buffer-size-kb: 34
                        receive-buffer-size-kb: 67
                        linger-seconds: 11
                        keep-count: 12
                        keep-interval-seconds: 13
                        keep-idle-seconds: 14
                      symmetric-encryption:
                        enabled: true
                        algorithm: Algorithm
                        salt: thesalt
                        password: thepassword
                        iteration-count: 1000
                      port:
                        port-count: 93
                        auto-increment: false
                        port: 9191
                      public-address: 10.20.10.10
                      reuse-address: true
                    rest-server-socket-endpoint-config:
                      name: REST
                      port:
                        port: 8080
                      endpoint-groups:
                        WAN:
                          enabled: true
                        CLUSTER_READ:
                          enabled: true
                        CLUSTER_WRITE:
                          enabled: false
                        HEALTH_CHECK:
                          enabled: true
                    memcache-server-socket-endpoint-config:
                      name: MEMCACHE
                      outbound-ports:
                        ports: 42000-42100
                    wan-server-socket-endpoint-config:
                      WAN_SERVER1:
                        outbound-ports:
                          ports: 52000-52100
                      WAN_SERVER2:
                        outbound-ports:
                          ports: 53000-53100
                    wan-endpoint-config:
                      WAN_ENDPOINT1:
                        outbound-ports:
                          ports: 62000-62100
                      WAN_ENDPOINT2:
                        outbound-ports:
                          ports: 63000-63100
                    client-server-socket-endpoint-config:
                      name: CLIENT
                      outbound-ports:
                        ports: 72000-72100
                """;

        return buildConfig(yaml);
    }

    @Override
    @Test
    public void testCPSubsystemConfig() {
        String yaml = """
                hazelcast:
                  cp-subsystem:
                    cp-member-count: 10
                    group-size: 5
                    session-time-to-live-seconds: 15
                    session-heartbeat-interval-seconds: 3
                    missing-cp-member-auto-removal-seconds: 120
                    fail-on-indeterminate-operation-state: true
                    persistence-enabled: true
                    base-dir: /mnt/cp-data
                    data-load-timeout-seconds: 30
                    cp-member-priority: -1
                    map-limit: 25
                    raft-algorithm:
                      leader-election-timeout-in-millis: 500
                      leader-heartbeat-period-in-millis: 100
                      max-missed-leader-heartbeat-count: 3
                      append-request-max-entry-count: 25
                      commit-index-advance-count-to-snapshot: 250
                      uncommitted-entry-count-to-reject-new-appends: 75
                      append-request-backoff-timeout-in-millis: 50
                    semaphores:
                      sem1:
                        jdk-compatible: true
                        initial-permits: 1
                      sem2:
                        jdk-compatible: false
                        initial-permits: 2
                    locks:
                      lock1:
                        lock-acquire-limit: 1
                      lock2:
                        lock-acquire-limit: 2
                    maps:
                      map1:
                        max-size-mb: 1
                      map2:
                        max-size-mb: 2
                """;
        Config config = buildConfig(yaml);
        CPSubsystemConfig cpSubsystemConfig = config.getCPSubsystemConfig();
        assertEquals(10, cpSubsystemConfig.getCPMemberCount());
        assertEquals(5, cpSubsystemConfig.getGroupSize());
        assertEquals(15, cpSubsystemConfig.getSessionTimeToLiveSeconds());
        assertEquals(3, cpSubsystemConfig.getSessionHeartbeatIntervalSeconds());
        assertEquals(120, cpSubsystemConfig.getMissingCPMemberAutoRemovalSeconds());
        assertTrue(cpSubsystemConfig.isFailOnIndeterminateOperationState());
        assertTrue(cpSubsystemConfig.isPersistenceEnabled());
        assertEquals(new File("/mnt/cp-data").getAbsoluteFile(), cpSubsystemConfig.getBaseDir().getAbsoluteFile());
        assertEquals(30, cpSubsystemConfig.getDataLoadTimeoutSeconds());
        assertEquals(-1, cpSubsystemConfig.getCPMemberPriority());
        RaftAlgorithmConfig raftAlgorithmConfig = cpSubsystemConfig.getRaftAlgorithmConfig();
        assertEquals(500, raftAlgorithmConfig.getLeaderElectionTimeoutInMillis());
        assertEquals(100, raftAlgorithmConfig.getLeaderHeartbeatPeriodInMillis());
        assertEquals(3, raftAlgorithmConfig.getMaxMissedLeaderHeartbeatCount());
        assertEquals(25, raftAlgorithmConfig.getAppendRequestMaxEntryCount());
        assertEquals(250, raftAlgorithmConfig.getCommitIndexAdvanceCountToSnapshot());
        assertEquals(75, raftAlgorithmConfig.getUncommittedEntryCountToRejectNewAppends());
        assertEquals(50, raftAlgorithmConfig.getAppendRequestBackoffTimeoutInMillis());
        SemaphoreConfig semaphoreConfig1 = cpSubsystemConfig.findSemaphoreConfig("sem1");
        SemaphoreConfig semaphoreConfig2 = cpSubsystemConfig.findSemaphoreConfig("sem2");
        assertNotNull(semaphoreConfig1);
        assertNotNull(semaphoreConfig2);
        assertTrue(semaphoreConfig1.isJDKCompatible());
        assertFalse(semaphoreConfig2.isJDKCompatible());
        assertEquals(1, semaphoreConfig1.getInitialPermits());
        assertEquals(2, semaphoreConfig2.getInitialPermits());
        FencedLockConfig lockConfig1 = cpSubsystemConfig.findLockConfig("lock1");
        FencedLockConfig lockConfig2 = cpSubsystemConfig.findLockConfig("lock2");
        assertNotNull(lockConfig1);
        assertNotNull(lockConfig2);
        assertEquals(1, lockConfig1.getLockAcquireLimit());
        assertEquals(2, lockConfig2.getLockAcquireLimit());
        CPMapConfig mapConfig1 = cpSubsystemConfig.findCPMapConfig("map1");
        CPMapConfig mapConfig2 = cpSubsystemConfig.findCPMapConfig("map2");
        assertNotNull(mapConfig1);
        assertNotNull(mapConfig2);
        assertEquals("map1", mapConfig1.getName());
        assertEquals(1, mapConfig1.getMaxSizeMb());
        assertEquals("map2", mapConfig2.getName());
        assertEquals(2, mapConfig2.getMaxSizeMb());
        assertEquals(25, cpSubsystemConfig.getCPMapLimit());
    }

    @Override
    @Test
    public void testSqlConfig() {
        String yaml = """
                hazelcast:
                  sql:
                    statement-timeout-millis: 30
                    catalog-persistence-enabled: true
                """;
        Config config = buildConfig(yaml);
        SqlConfig sqlConfig = config.getSqlConfig();
        assertEquals(30L, sqlConfig.getStatementTimeoutMillis());
        assertTrue(sqlConfig.isCatalogPersistenceEnabled());
    }

    @Override
    @Test
    public void testWhitespaceInNonSpaceStrings() {
        String yaml = """
                hazelcast:
                  split-brain-protection:
                    name-of-split-brain-protection:
                      enabled: true
                      protect-on:   WRITE  \s
                """;

        buildConfig(yaml);
    }

    @Override
    @Test
    public void testPersistentMemoryDirectoryConfiguration() {
        String yaml = """
                hazelcast:
                  native-memory:
                    persistent-memory:
                      directories:
                        - directory: /mnt/pmem0
                          numa-node: 0
                        - directory: /mnt/pmem1
                          numa-node: 1
                """;

        Config yamlConfig = new InMemoryYamlConfig(yaml);

        PersistentMemoryConfig pmemConfig = yamlConfig.getNativeMemoryConfig()
                .getPersistentMemoryConfig();
        List<PersistentMemoryDirectoryConfig> directoryConfigs = pmemConfig
                .getDirectoryConfigs();
        assertFalse(pmemConfig.isEnabled());
        assertEquals(MOUNTED, pmemConfig.getMode());
        assertEquals(2, directoryConfigs.size());
        PersistentMemoryDirectoryConfig dir0Config = directoryConfigs.get(0);
        PersistentMemoryDirectoryConfig dir1Config = directoryConfigs.get(1);
        assertEquals("/mnt/pmem0", dir0Config.getDirectory());
        assertEquals(0, dir0Config.getNumaNode());
        assertEquals("/mnt/pmem1", dir1Config.getDirectory());
        assertEquals(1, dir1Config.getNumaNode());
    }

    @Test
    public void cacheEntryListenerConfigParsing() {
        String yaml = """
                hazelcast:
                  cache:
                    my-cache:
                      cache-entry-listeners:
                        - old-value-required: true
                          synchronous: true
                          cache-entry-listener-factory:
                            class-name: com.example.cache.MyEntryListenerFactory
                          cache-entry-event-filter-factory:
                            class-name: com.example.cache.MyEntryEventFilterFactory""";
        Config actual = buildConfig(yaml);
        CacheSimpleEntryListenerConfig expected = new CacheSimpleEntryListenerConfig()
                .setOldValueRequired(true)
                .setSynchronous(true)
                .setCacheEntryListenerFactory("com.example.cache.MyEntryListenerFactory")
                .setCacheEntryEventFilterFactory("com.example.cache.MyEntryEventFilterFactory");

        List<CacheSimpleEntryListenerConfig> actualListeners = actual.findCacheConfig("my-cache").getCacheEntryListeners();
        assertEquals(singletonList(expected), actualListeners);
    }

    @Override
    @Test
    public void testPersistentMemoryDirectoryConfigurationSimple() {
        String yaml = """
                hazelcast:
                  native-memory:
                    persistent-memory-directory: /mnt/pmem0""";

        Config config = buildConfig(yaml);
        PersistentMemoryConfig pmemConfig = config.getNativeMemoryConfig().getPersistentMemoryConfig();
        assertTrue(pmemConfig.isEnabled());

        List<PersistentMemoryDirectoryConfig> directoryConfigs = pmemConfig.getDirectoryConfigs();
        assertEquals(1, directoryConfigs.size());
        PersistentMemoryDirectoryConfig dir0Config = directoryConfigs.get(0);
        assertEquals("/mnt/pmem0", dir0Config.getDirectory());
        assertFalse(dir0Config.isNumaNodeSet());
    }

    @Override
    @Test(expected = InvalidConfigurationException.class)
    public void testPersistentMemoryDirectoryConfiguration_uniqueDirViolationThrows() {
        String yaml = """
                hazelcast:
                  native-memory:
                    persistent-memory:
                      directories:
                        - directory: /mnt/pmem0
                          numa-node: 0
                        - directory: /mnt/pmem0
                          numa-node: 1
                """;

        buildConfig(yaml);
    }

    @Override
    @Test(expected = InvalidConfigurationException.class)
    public void testPersistentMemoryDirectoryConfiguration_uniqueNumaNodeViolationThrows() {
        String yaml = """
                hazelcast:
                  native-memory:
                    persistent-memory:
                      directories:
                        - directory: /mnt/pmem0
                          numa-node: 0
                        - directory: /mnt/pmem1
                          numa-node: 0
                """;

        buildConfig(yaml);
    }

    @Override
    @Test(expected = InvalidConfigurationException.class)
    public void testPersistentMemoryDirectoryConfiguration_numaNodeConsistencyViolationThrows() {
        String yaml = """
                hazelcast:
                  native-memory:
                    persistent-memory:
                      directories:
                        - directory: /mnt/pmem0
                          numa-node: 0
                        - directory: /mnt/pmem1
                """;

        buildConfig(yaml);
    }

    @Override
    @Test
    public void testPersistentMemoryDirectoryConfiguration_simpleAndAdvancedPasses() {
        String yaml = """
                hazelcast:
                  native-memory:
                    persistent-memory-directory: /mnt/optane
                    persistent-memory:
                      directories:
                        - directory: /mnt/pmem0
                        - directory: /mnt/pmem1
                """;

        Config config = buildConfig(yaml);

        PersistentMemoryConfig pmemConfig = config.getNativeMemoryConfig().getPersistentMemoryConfig();
        assertTrue(pmemConfig.isEnabled());
        assertEquals(MOUNTED, pmemConfig.getMode());

        List<PersistentMemoryDirectoryConfig> directoryConfigs = pmemConfig.getDirectoryConfigs();
        assertEquals(3, directoryConfigs.size());
        PersistentMemoryDirectoryConfig dir0Config = directoryConfigs.get(0);
        PersistentMemoryDirectoryConfig dir1Config = directoryConfigs.get(1);
        PersistentMemoryDirectoryConfig dir2Config = directoryConfigs.get(2);
        assertEquals("/mnt/optane", dir0Config.getDirectory());
        assertFalse(dir0Config.isNumaNodeSet());
        assertEquals("/mnt/pmem0", dir1Config.getDirectory());
        assertFalse(dir1Config.isNumaNodeSet());
        assertEquals("/mnt/pmem1", dir2Config.getDirectory());
        assertFalse(dir2Config.isNumaNodeSet());
    }

    @Override
    @Test
    public void testPersistentMemoryConfiguration_SystemMemoryMode() {
        String yaml = """
                hazelcast:
                  native-memory:
                    persistent-memory:
                      enabled: true
                      mode: SYSTEM_MEMORY
                """;

        Config config = buildConfig(yaml);
        PersistentMemoryConfig pmemConfig = config.getNativeMemoryConfig().getPersistentMemoryConfig();
        assertTrue(pmemConfig.isEnabled());
        assertEquals(SYSTEM_MEMORY, pmemConfig.getMode());
    }

    @Override
    @Test(expected = InvalidConfigurationException.class)
    public void testPersistentMemoryConfiguration_NotExistingModeThrows() {
        String yaml = """
                hazelcast:
                  native-memory:
                    persistent-memory:
                      mode: NOT_EXISTING_MODE
                """;

        buildConfig(yaml);
    }

    @Override
    @Test(expected = InvalidConfigurationException.class)
    public void testPersistentMemoryDirectoryConfiguration_SystemMemoryModeThrows() {
        String yaml = """
                hazelcast:
                  native-memory:
                    persistent-memory:
                      mode: SYSTEM_MEMORY
                      directories:
                        - directory: /mnt/pmem0
                """;

        buildConfig(yaml);
    }

    @Override
    @Test
    public void testMetricsConfig() {
        String yaml = """
                hazelcast:
                  metrics:
                    enabled: false
                    management-center:
                      enabled: false
                      retention-seconds: 11
                    jmx:
                      enabled: false
                    collection-frequency-seconds: 10""";
        Config config = new InMemoryYamlConfig(yaml);
        MetricsConfig metricsConfig = config.getMetricsConfig();
        assertFalse(metricsConfig.isEnabled());
        MetricsManagementCenterConfig metricsMcConfig = metricsConfig.getManagementCenterConfig();
        assertFalse(metricsMcConfig.isEnabled());
        assertFalse(metricsConfig.getJmxConfig().isEnabled());
        assertEquals(10, metricsConfig.getCollectionFrequencySeconds());
        assertEquals(11, metricsMcConfig.getRetentionSeconds());
    }

    @Override
    @Test
    public void testInstanceTrackingConfig() {
        String yaml = """
                hazelcast:
                  instance-tracking:
                    enabled: true
                    file-name: /dummy/file
                    format-pattern: dummy-pattern with $HZ_INSTANCE_TRACKING{placeholder} and $RND{placeholder}""";
        Config config = new InMemoryYamlConfig(yaml);
        InstanceTrackingConfig trackingConfig = config.getInstanceTrackingConfig();
        assertTrue(trackingConfig.isEnabled());
        assertEquals("/dummy/file", trackingConfig.getFileName());
        assertEquals("dummy-pattern with $HZ_INSTANCE_TRACKING{placeholder} and $RND{placeholder}",
                trackingConfig.getFormatPattern());
    }

    @Override
    @Test
    public void testMetricsConfigMasterSwitchDisabled() {
        String yaml = """
                hazelcast:
                  metrics:
                    enabled: false""";
        Config config = new InMemoryYamlConfig(yaml);
        MetricsConfig metricsConfig = config.getMetricsConfig();
        assertFalse(metricsConfig.isEnabled());
        assertTrue(metricsConfig.getManagementCenterConfig().isEnabled());
        assertTrue(metricsConfig.getJmxConfig().isEnabled());
    }

    @Override
    @Test
    public void testMetricsConfigMcDisabled() {
        String yaml = """
                hazelcast:
                  metrics:
                    management-center:
                      enabled: false""";
        Config config = new InMemoryYamlConfig(yaml);
        MetricsConfig metricsConfig = config.getMetricsConfig();
        assertTrue(metricsConfig.isEnabled());
        assertFalse(metricsConfig.getManagementCenterConfig().isEnabled());
        assertTrue(metricsConfig.getJmxConfig().isEnabled());
    }

    @Override
    @Test
    public void testMetricsConfigJmxDisabled() {
        String yaml = """
                hazelcast:
                  metrics:
                    jmx:
                      enabled: false""";
        Config config = new InMemoryYamlConfig(yaml);
        MetricsConfig metricsConfig = config.getMetricsConfig();
        assertTrue(metricsConfig.isEnabled());
        assertTrue(metricsConfig.getManagementCenterConfig().isEnabled());
        assertFalse(metricsConfig.getJmxConfig().isEnabled());
    }

    @Override
    protected Config buildAuditlogConfig() {
        String yaml = """
                hazelcast:
                  auditlog:
                    enabled: true
                    factory-class-name: com.acme.auditlog.AuditlogToSyslogFactory
                    properties:
                      host: syslogserver.acme.com
                      port: 514
                      type: tcp
                """;
        return new InMemoryYamlConfig(yaml);
    }

    @Override
    protected Config buildMapWildcardConfig() {
        String yaml = """
                hazelcast:
                  map:
                    map*:
                      attributes:
                        name:
                          extractor-class-name: usercodedeployment.CapitalizingFirstNameExtractor
                    mapBackup2*:
                      backup-count: 2
                      attributes:
                        name:
                          extractor-class-name: usercodedeployment.CapitalizingFirstNameExtractor
                """;

        return new InMemoryYamlConfig(yaml);
    }

    @Override
    @Test
    public void testIntegrityCheckerConfig() {
        String yaml = """
                hazelcast:
                  integrity-checker:
                    enabled: false
                """;

        Config config = buildConfig(yaml);

        assertFalse(config.getIntegrityCheckerConfig().isEnabled());
    }

    @Override
    public void testDataConnectionConfigs() {
        String yaml = """
                hazelcast:
                  data-connection:
                    mysql-database:
                      type: jdbc
                      properties:
                        jdbcUrl: jdbc:mysql://dummy:3306
                        some.property: dummy-value
                      shared: true
                    other-database:
                      type: other
                """;

        Config config = new InMemoryYamlConfig(yaml);

        Map<String, DataConnectionConfig> dataConnectionConfigs = config.getDataConnectionConfigs();

        assertThat(dataConnectionConfigs).hasSize(2);
        assertThat(dataConnectionConfigs).containsKey("mysql-database");
        DataConnectionConfig mysqlDataConnectionConfig = dataConnectionConfigs.get("mysql-database");
        assertThat(mysqlDataConnectionConfig.getType()).isEqualTo("jdbc");
        assertThat(mysqlDataConnectionConfig.getName()).isEqualTo("mysql-database");
        assertThat(mysqlDataConnectionConfig.isShared()).isTrue();
        assertThat(mysqlDataConnectionConfig.getProperty("jdbcUrl")).isEqualTo("jdbc:mysql://dummy:3306");
        assertThat(mysqlDataConnectionConfig.getProperty("some.property")).isEqualTo("dummy-value");

        assertThat(dataConnectionConfigs).containsKey("other-database");
        DataConnectionConfig otherDataConnectionConfig = dataConnectionConfigs.get("other-database");
        assertThat(otherDataConnectionConfig.getType()).isEqualTo("other");
    }

    @Override
    @Test
    public void testPartitioningAttributeConfigs() {
        String yaml = """
                hazelcast:
                  map:
                    test:
                      partition-attributes:
                        - name: attr1
                        - name: attr2
                """;

        final MapConfig mapConfig = buildConfig(yaml).getMapConfig("test");
        assertThat(mapConfig.getPartitioningAttributeConfigs()).containsExactly(
                new PartitioningAttributeConfig("attr1"),
                new PartitioningAttributeConfig("attr2")
        );
    }

    @Override
    public void testNamespaceConfigs() throws IOException {

        File tempJar = tempFolder.newFile("tempJar.jar");
        try (FileOutputStream out = new FileOutputStream(tempJar)) {
            out.write(new byte[]{0x50, 0x4B, 0x03, 0x04});
        }
        File tempJarZip = tempFolder.newFile("tempZip.zip");
        File tempClass = tempFolder.newFile("TempClass.class");

        String yamlTestString = "hazelcast:\n"
                + "  user-code-namespaces:\n"
                + "    enabled: true\n"
                + "    class-filter:\n"
                + "      defaults-disabled: false\n"
                + "      blacklist:\n"
                + "        class:\n"
                + "          - com.acme.app.BeanComparator\n"
                + "      whitelist:\n"
                + "        package:\n"
                + "          - com.acme.app\n"
                + "        prefix:\n"
                + "          - com.hazelcast.\n"
                + "    ns1:\n"
                + "      - id: \"jarId\"\n"
                + "        resource-type: \"jar\"\n"
                + "        url: " + tempJar.toURI().toURL() + "\n"
                + "      - id: \"zipId\"\n"
                + "        resource-type: \"jars_in_zip\"\n"
                + "        url: " + tempJarZip.toURI().toURL() + "\n"
                + "      - id: \"classId\"\n"
                + "        resource-type: \"class\"\n"
                + "        url: " + tempClass.toURI().toURL() + "\n"
                + "    ns2:\n"
                + "      - id: \"jarId2\"\n"
                + "        resource-type: \"jar\"\n"
                + "        url: " + tempJar.toURI().toURL() + "\n";

        final UserCodeNamespacesConfig userCodeNamespacesConfig = buildConfig(yamlTestString).getNamespacesConfig();
        assertThat(userCodeNamespacesConfig.isEnabled()).isTrue();
        assertThat(userCodeNamespacesConfig.getNamespaceConfigs()).hasSize(2);
        final UserCodeNamespaceConfig userCodeNamespaceConfig = userCodeNamespacesConfig.getNamespaceConfigs().get("ns1");

        assertNotNull(userCodeNamespaceConfig);

        assertThat(userCodeNamespaceConfig.getName()).isEqualTo("ns1");
        assertThat(userCodeNamespaceConfig.getResourceConfigs()).hasSize(3);

        // validate NS1 ResourceDefinition contents.
        Collection<ResourceDefinition> ns1Resources = userCodeNamespaceConfig.getResourceConfigs();
        Optional<ResourceDefinition> jarIdResource = ns1Resources.stream().filter(r -> r.id().equals("jarId")).findFirst();
        assertThat(jarIdResource).isPresent();
        assertThat(jarIdResource.get().url()).isEqualTo(tempJar.toURI().toURL().toString());
        assertEquals(ResourceType.JAR, jarIdResource.get().type());
        // check the bytes[] are equal
        assertArrayEquals(getTestFileBytes(tempJar), jarIdResource.get().payload());
        Optional<ResourceDefinition> zipId = ns1Resources.stream().filter(r -> r.id().equals("zipId")).findFirst();
        Optional<ResourceDefinition> classId = ns1Resources.stream().filter(r -> r.id().equals("classId")).findFirst();
        assertThat(zipId).isPresent();
        assertThat(zipId.get().url()).isEqualTo(tempJarZip.toURI().toURL().toString());
        assertEquals(ResourceType.JARS_IN_ZIP, zipId.get().type());
        assertThat(classId).isPresent();
        assertThat(classId.get().url()).isEqualTo(tempClass.toURI().toURL().toString());
        assertEquals(ResourceType.CLASS, classId.get().type());
        // check the bytes[] are equal
        assertArrayEquals(getTestFileBytes(tempJarZip), zipId.get().payload());
        // validate NS2 ResourceDefinition contents.
        final UserCodeNamespaceConfig userCodeNamespaceConfig2 = userCodeNamespacesConfig.getNamespaceConfigs().get("ns2");
        assertNotNull(userCodeNamespaceConfig2);
        assertThat(userCodeNamespaceConfig2.getName()).isEqualTo("ns2");
        assertThat(userCodeNamespaceConfig2.getResourceConfigs()).hasSize(1);
        Collection<ResourceDefinition> ns2Resources = userCodeNamespaceConfig2.getResourceConfigs();
        assertThat(ns2Resources).hasSize(1);
        Optional<ResourceDefinition> jarId2Resource = ns2Resources.stream().filter(r -> r.id().equals("jarId2")).findFirst();
        assertThat(jarId2Resource).isPresent();
        assertThat(jarId2Resource.get().url()).isEqualTo(tempJar.toURI().toURL().toString());
        assertEquals(ResourceType.JAR, jarId2Resource.get().type());
        // check the bytes[] are equal
        assertArrayEquals(getTestFileBytes(tempJar), jarId2Resource.get().payload());

        // Validate filtering config
        assertNotNull(userCodeNamespacesConfig.getClassFilterConfig());
        JavaSerializationFilterConfig filterConfig = userCodeNamespacesConfig.getClassFilterConfig();
        assertFalse(filterConfig.isDefaultsDisabled());
        assertTrue(filterConfig.getWhitelist().isListed("com.acme.app.FakeClass"));
        assertTrue(filterConfig.getWhitelist().isListed("com.hazelcast.fake.place.MagicClass"));
        assertFalse(filterConfig.getWhitelist().isListed("not.in.the.whitelist.ClassName"));
        assertTrue(filterConfig.getBlacklist().isListed("com.acme.app.BeanComparator"));
        assertFalse(filterConfig.getBlacklist().isListed("not.in.the.blacklist.ClassName"));
    }

    @Test
    public void testNamespaceConfigs_newStyle() throws IOException {

        File tempJar = tempFolder.newFile("tempJar.jar");
        try (FileOutputStream out = new FileOutputStream(tempJar)) {
            out.write(new byte[]{0x50, 0x4B, 0x03, 0x04});
        }
        File tempJarZip = tempFolder.newFile("tempZip.zip");
        File tempClass = tempFolder.newFile("TempClass.class");

        String yamlTestString = "hazelcast:\n"
                + "  user-code-namespaces:\n"
                + "    enabled: true\n"
                + "    class-filter:\n"
                + "      defaults-disabled: false\n"
                + "      blacklist:\n"
                + "        class:\n"
                + "          - com.acme.app.BeanComparator\n"
                + "      whitelist:\n"
                + "        package:\n"
                + "          - com.acme.app\n"
                + "        prefix:\n"
                + "          - com.hazelcast.\n"
                + "    name-spaces:\n"
                + "      ns1:\n"
                + "        - id: \"jarId\"\n"
                + "          resource-type: \"jar\"\n"
                + "          url: " + tempJar.toURI().toURL() + "\n"
                + "        - id: \"zipId\"\n"
                + "          resource-type: \"jars_in_zip\"\n"
                + "          url: " + tempJarZip.toURI().toURL() + "\n"
                + "        - id: \"classId\"\n"
                + "          resource-type: \"class\"\n"
                + "          url: " + tempClass.toURI().toURL() + "\n"
                + "      ns2:\n"
                + "        - id: \"jarId2\"\n"
                + "          resource-type: \"jar\"\n"
                + "          url: " + tempJar.toURI().toURL() + "\n";

        final UserCodeNamespacesConfig userCodeNamespacesConfig = buildConfig(yamlTestString).getNamespacesConfig();
        assertThat(userCodeNamespacesConfig.isEnabled()).isTrue();
        assertThat(userCodeNamespacesConfig.getNamespaceConfigs()).hasSize(2);
        final UserCodeNamespaceConfig userCodeNamespaceConfig = userCodeNamespacesConfig.getNamespaceConfigs().get("ns1");

        assertNotNull(userCodeNamespaceConfig);

        assertThat(userCodeNamespaceConfig.getName()).isEqualTo("ns1");
        assertThat(userCodeNamespaceConfig.getResourceConfigs()).hasSize(3);

        // validate NS1 ResourceDefinition contents.
        Collection<ResourceDefinition> ns1Resources = userCodeNamespaceConfig.getResourceConfigs();
        Optional<ResourceDefinition> jarIdResource = ns1Resources.stream().filter(r -> r.id().equals("jarId")).findFirst();
        assertThat(jarIdResource).isPresent();
        assertThat(jarIdResource.get().url()).isEqualTo(tempJar.toURI().toURL().toString());
        assertEquals(ResourceType.JAR, jarIdResource.get().type());
        // check the bytes[] are equal
        assertArrayEquals(getTestFileBytes(tempJar), jarIdResource.get().payload());
        Optional<ResourceDefinition> zipId = ns1Resources.stream().filter(r -> r.id().equals("zipId")).findFirst();
        Optional<ResourceDefinition> classId = ns1Resources.stream().filter(r -> r.id().equals("classId")).findFirst();
        assertThat(zipId).isPresent();
        assertThat(zipId.get().url()).isEqualTo(tempJarZip.toURI().toURL().toString());
        assertEquals(ResourceType.JARS_IN_ZIP, zipId.get().type());
        assertThat(classId).isPresent();
        assertThat(classId.get().url()).isEqualTo(tempClass.toURI().toURL().toString());
        assertEquals(ResourceType.CLASS, classId.get().type());
        // check the bytes[] are equal
        assertArrayEquals(getTestFileBytes(tempJarZip), zipId.get().payload());
        // validate NS2 ResourceDefinition contents.
        final UserCodeNamespaceConfig userCodeNamespaceConfig2 = userCodeNamespacesConfig.getNamespaceConfigs().get("ns2");
        assertNotNull(userCodeNamespaceConfig2);
        assertThat(userCodeNamespaceConfig2.getName()).isEqualTo("ns2");
        assertThat(userCodeNamespaceConfig2.getResourceConfigs()).hasSize(1);
        Collection<ResourceDefinition> ns2Resources = userCodeNamespaceConfig2.getResourceConfigs();
        assertThat(ns2Resources).hasSize(1);
        Optional<ResourceDefinition> jarId2Resource = ns2Resources.stream().filter(r -> r.id().equals("jarId2")).findFirst();
        assertThat(jarId2Resource).isPresent();
        assertThat(jarId2Resource.get().url()).isEqualTo(tempJar.toURI().toURL().toString());
        assertEquals(ResourceType.JAR, jarId2Resource.get().type());
        // check the bytes[] are equal
        assertArrayEquals(getTestFileBytes(tempJar), jarId2Resource.get().payload());

        // Validate filtering config
        assertNotNull(userCodeNamespacesConfig.getClassFilterConfig());
        JavaSerializationFilterConfig filterConfig = userCodeNamespacesConfig.getClassFilterConfig();
        assertFalse(filterConfig.isDefaultsDisabled());
        assertTrue(filterConfig.getWhitelist().isListed("com.acme.app.FakeClass"));
        assertTrue(filterConfig.getWhitelist().isListed("com.hazelcast.fake.place.MagicClass"));
        assertFalse(filterConfig.getWhitelist().isListed("not.in.the.whitelist.ClassName"));
        assertTrue(filterConfig.getBlacklist().isListed("com.acme.app.BeanComparator"));
        assertFalse(filterConfig.getBlacklist().isListed("not.in.the.blacklist.ClassName"));
    }

    /**
     * Unit test for {@link YamlMemberDomConfigProcessor}. It is placed under {@link com.hazelcast.config} package,
     * because we need access to the {@link UserCodeNamespacesConfig#getNamespaceConfigs()} package-private method.
     */
    @Test
    public void unitTestNamespaceConfigs_oldStyle() throws IOException {
        File tempJar = tempFolder.newFile("tempJar.jar");

        String yamlTestString = "hazelcast:\n"
                + "  user-code-namespaces:\n"
                + "    enabled: true\n"
                + "    ns1:\n"
                + "      - id: \"jarId1\"\n"
                + "        resource-type: \"jar\"\n"
                + "        url: " + tempJar.toURI().toURL() + "\n"
                + "      - id: \"jarId2\"\n"
                + "        resource-type: \"jar\"\n"
                + "        url: " + tempJar.toURI().toURL() + "\n"
                + "    ns2:\n"
                + "      - id: \"jarId3\"\n"
                + "        resource-type: \"jar\"\n"
                + "        url: " + tempJar.toURI().toURL() + "\n"
                + "      - id: \"jarId4\"\n"
                + "        resource-type: \"jar\"\n"
                + "        url: " + tempJar.toURI().toURL() + "\n";

        assertNamespaceConfig(yamlTestString);
    }

    /**
     * Unit test for {@link YamlMemberDomConfigProcessor}. It is placed under {@link com.hazelcast.config} package,
     * because we need access to the {@link UserCodeNamespacesConfig#getNamespaceConfigs()} package-private method.
     */
    @Test
    public void unitTestNamespaceConfigs_newStyle() throws IOException {
        File tempJar = tempFolder.newFile("tempJar.jar");

        String yamlTestString = "hazelcast:\n"
                + "  user-code-namespaces:\n"
                + "    enabled: true\n"
                + "    name-spaces:\n"
                + "      ns1:\n"
                + "        - id: \"jarId1\"\n"
                + "          resource-type: \"jar\"\n"
                + "          url: " + tempJar.toURI().toURL() + "\n"
                + "        - id: \"jarId2\"\n"
                + "          resource-type: \"jar\"\n"
                + "          url: " + tempJar.toURI().toURL() + "\n"
                + "      ns2:\n"
                + "        - id: \"jarId3\"\n"
                + "          resource-type: \"jar\"\n"
                + "          url: " + tempJar.toURI().toURL() + "\n"
                + "        - id: \"jarId4\"\n"
                + "          resource-type: \"jar\"\n"
                + "          url: " + tempJar.toURI().toURL() + "\n";

        assertNamespaceConfig(yamlTestString);
    }

    /**
     * Unit test for {@link YamlMemberDomConfigProcessor}. It is placed under {@link com.hazelcast.config} package,
     * because we need access to the {@link UserCodeNamespacesConfig#getNamespaceConfigs()} package-private method.
     */
    @Test
    public void unitTestDuplicatedNamespaceConfigs_mixedStyle_throws() throws IOException {
        File tempJar = tempFolder.newFile("tempJar.jar");

        /*
           name-spaces:
              ns1
           ns1
         */
        final String yamlTestString = "hazelcast:\n"
                + "  user-code-namespaces:\n"
                + "    enabled: true\n"
                + "    name-spaces:\n"
                + "      ns1:\n"
                + "        - id: \"jarId1\"\n"
                + "          resource-type: \"jar\"\n"
                + "          url: " + tempJar.toURI().toURL() + "\n"
                + "        - id: \"jarId2\"\n"
                + "          resource-type: \"jar\"\n"
                + "          url: " + tempJar.toURI().toURL() + "\n"
                + "    ns1:\n"
                + "      - id: \"jarId3\"\n"
                + "        resource-type: \"jar\"\n"
                + "        url: " + tempJar.toURI().toURL() + "\n"
                + "      - id: \"jarId4\"\n"
                + "        resource-type: \"jar\"\n"
                + "        url: " + tempJar.toURI().toURL() + "\n";

        assertThatThrownBy(() -> buildConfig(yamlTestString).getNamespacesConfig())
                .isInstanceOf(InvalidConfigurationException.class);

        /*
           ns1
           name-spaces:
              ns1
         */
        final String _yamlTestString = "hazelcast:\n"
                + "  user-code-namespaces:\n"
                + "    enabled: true\n"
                + "    ns1:\n"
                + "      - id: \"jarId3\"\n"
                + "        resource-type: \"jar\"\n"
                + "        url: " + tempJar.toURI().toURL() + "\n"
                + "      - id: \"jarId4\"\n"
                + "        resource-type: \"jar\"\n"
                + "        url: " + tempJar.toURI().toURL() + "\n"
                + "    name-spaces:\n"
                + "      ns1:\n"
                + "        - id: \"jarId1\"\n"
                + "          resource-type: \"jar\"\n"
                + "          url: " + tempJar.toURI().toURL() + "\n"
                + "        - id: \"jarId2\"\n"
                + "          resource-type: \"jar\"\n"
                + "          url: " + tempJar.toURI().toURL() + "\n";

        assertThatThrownBy(() -> buildConfig(_yamlTestString).getNamespacesConfig())
                .isInstanceOf(InvalidConfigurationException.class);
    }

    @Test
    public void unitTestNamespaceConfigs_throws() throws IOException {
        File tempJar = tempFolder.newFile("tempJar.jar");

        String yamlTestString = "hazelcast:\n"
                + "  user-code-namespaces:\n"
                + "    enabled: true\n"
                + "    name-spaces:\n"
                + "      ns1:\n"
                + "        - id: \"jarId1\"\n"
                + "          resource-type: \"jars\"\n"
                + "          url: " + tempJar.toURI().toURL() + "\n";

        assertThatThrownBy(() -> buildConfig(yamlTestString))
                .isInstanceOf(InvalidConfigurationException.class)
                .hasMessageContaining("was configured with invalid resource type");
    }

    private void assertNamespaceConfig(String yamlTestString) {
        final UserCodeNamespacesConfig ucnConfig = buildConfig(yamlTestString).getNamespacesConfig();
        assertNotNull(ucnConfig);
        assertTrue(ucnConfig.isEnabled());
        Map<String, UserCodeNamespaceConfig> namespaceConfigs = ucnConfig.getNamespaceConfigs();
        assertEquals(2, namespaceConfigs.size());
        assertTrue(namespaceConfigs.keySet().containsAll(asList("ns1", "ns2")));
        namespaceConfigs.values().forEach(namespaceConfig ->
                assertEquals(2, namespaceConfig.getResourceConfigs().size()));
    }

    @Override
    public void testRestConfig() throws IOException {
        String yaml = """
                hazelcast:
                  rest:
                    enabled: true
                    port: 8080
                    security-realm: realmName
                    token-validity-seconds: 500
                    ssl:
                      enabled: true
                      client-auth: NEED
                      ciphers: TLS_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA256
                      enabled-protocols: TLSv1.2, TLSv1.3
                      key-alias: myKeyAlias
                      key-password: myKeyPassword
                      key-store: /path/to/keystore
                      key-store-password: myKeyStorePassword
                      key-store-type: JKS
                      key-store-provider: SUN
                      trust-store: /path/to/truststore
                      trust-store-password: myTrustStorePassword
                      trust-store-type: JKS
                      trust-store-provider: SUN
                      protocol: TLS
                      certificate: /path/to/certificate
                      certificate-key: /path/to/certificate-key
                      trust-certificate: /path/to/trust-certificate
                      trust-certificate-key: /path/to/trust-certificate-key
                """;

        Config config = buildConfig(yaml);
        validateRestConfig(config);
    }

    @Override
    public void testMapExpiryConfig() {
        String yaml = """
                hazelcast:
                  map:
                    expiry:
                      time-to-live-seconds: 2147483647
                      max-idle-seconds: 2147483647
                """;

        Config config = buildConfig(yaml);
        MapConfig mapConfig = config.getMapConfig("expiry");

        assertEquals(Integer.MAX_VALUE, mapConfig.getTimeToLiveSeconds());
        assertEquals(Integer.MAX_VALUE, mapConfig.getMaxIdleSeconds());
    }

    @Override
    @Test
    public void testTpcConfig() {
        String yaml = """
                hazelcast:
                  tpc:
                    enabled: true
                    eventloop-count: 12
                """;

        TpcConfig tpcConfig = buildConfig(yaml).getTpcConfig();

        assertThat(tpcConfig.isEnabled()).isTrue();
        assertThat(tpcConfig.getEventloopCount()).isEqualTo(12);
    }

    @Override
    @Test
    public void testTpcSocketConfig() {
        String yaml = """
                hazelcast:
                  network:
                    tpc-socket:
                      port-range: 14000-16000
                      receive-buffer-size-kb: 256
                      send-buffer-size-kb: 256
                """;

        TpcSocketConfig tpcSocketConfig = buildConfig(yaml).getNetworkConfig().getTpcSocketConfig();

        assertThat(tpcSocketConfig.getPortRange()).isEqualTo("14000-16000");
        assertThat(tpcSocketConfig.getReceiveBufferSizeKB()).isEqualTo(256);
        assertThat(tpcSocketConfig.getSendBufferSizeKB()).isEqualTo(256);
    }

    @Override
    @Test
    public void testTpcSocketConfigAdvanced() {
        String yaml = """
                hazelcast:
                  advanced-network:
                    enabled: true
                    member-server-socket-endpoint-config:\s
                      tpc-socket:\s
                        port-range: 14000-16000
                        receive-buffer-size-kb: 256
                        send-buffer-size-kb: 256
                    client-server-socket-endpoint-config:
                      tpc-socket:
                        port-range: 14000-16000
                        receive-buffer-size-kb: 256
                        send-buffer-size-kb: 256
                    memcache-server-socket-endpoint-config:
                      tpc-socket:
                        port-range: 14000-16000
                        receive-buffer-size-kb: 256
                        send-buffer-size-kb: 256
                    rest-server-socket-endpoint-config:
                      tpc-socket:
                        port-range: 14000-16000
                        receive-buffer-size-kb: 256
                        send-buffer-size-kb: 256
                    wan-endpoint-config:\s
                      tokyo:
                        tpc-socket:
                          port-range: 14000-16000
                          receive-buffer-size-kb: 256
                          send-buffer-size-kb: 256
                    wan-server-socket-endpoint-config:\s
                      london:
                        tpc-socket:
                          port-range: 14000-16000
                          receive-buffer-size-kb: 256
                          send-buffer-size-kb: 256
                """;

        Map<EndpointQualifier, EndpointConfig> endpointConfigs = buildConfig(yaml)
                .getAdvancedNetworkConfig()
                .getEndpointConfigs();

        assertThat(endpointConfigs).hasSize(6);

        endpointConfigs.forEach((endpointQualifier, endpointConfig) -> {
            TpcSocketConfig tpcSocketConfig = endpointConfig.getTpcSocketConfig();

            assertThat(tpcSocketConfig.getPortRange()).isEqualTo("14000-16000");
            assertThat(tpcSocketConfig.getReceiveBufferSizeKB()).isEqualTo(256);
            assertThat(tpcSocketConfig.getSendBufferSizeKB()).isEqualTo(256);
        });
    }

    @Override
    public void testVectorCollectionConfig() {
        String yaml = """
                hazelcast:
                  vector-collection:
                    vector-1:
                      indexes:
                        - name: index-1-1
                          dimension: 2
                          metric: DOT
                          max-degree: 10
                          ef-construction: 10
                          use-deduplication: true
                        - name: index-1-2
                          dimension: 3
                          metric: EUCLIDEAN
                    vector-2:
                      indexes:
                        - dimension: 4
                          metric: COSINE
                          use-deduplication: false
                """;

        Config config = buildConfig(yaml);
        validateVectorCollectionConfig(config);
    }

    public String getAdvancedNetworkConfigWithSocketOption(String socketOption, int value) {
        return "hazelcast:\n"
                + "  advanced-network:\n"
                + "    enabled: true\n"
                + "    member-server-socket-endpoint-config: \n"
                + "      socket-options: \n"
                + "        " + socketOption + ": " + value + "\n";
    }
}