public static NamedConfig buildMapConfig(final BaseHazelcastProperties hz,
                                             final String mapName, final long timeoutSeconds) {
        val cluster = hz.getCluster();

        val evictionPolicy = EvictionPolicy.valueOf(cluster.getCore().getEvictionPolicy());

        val evictionConfig = new EvictionConfig();
        evictionConfig.setEvictionPolicy(evictionPolicy);
        evictionConfig.setMaxSizePolicy(MaxSizePolicy.valueOf(cluster.getCore().getMaxSizePolicy()));
        evictionConfig.setSize(cluster.getCore().getMaxSize());

        val mergePolicyConfig = new MergePolicyConfig();
        if (StringUtils.hasText(cluster.getCore().getMapMergePolicy())) {
            switch (cluster.getCore().getMapMergePolicy().trim().toLowerCase(Locale.ENGLISH)) {
                case "discard" -> mergePolicyConfig.setPolicy(DiscardMergePolicy.class.getName());
                case "pass_through" -> mergePolicyConfig.setPolicy(PassThroughMergePolicy.class.getName());
                case "expiration_time" -> mergePolicyConfig.setPolicy(ExpirationTimeMergePolicy.class.getName());
                case "higher_hits" -> mergePolicyConfig.setPolicy(HigherHitsMergePolicy.class.getName());
                case "latest_update" -> mergePolicyConfig.setPolicy(LatestUpdateMergePolicy.class.getName());
                case "latest_access" -> mergePolicyConfig.setPolicy(LatestAccessMergePolicy.class.getName());
                case "put_if_absent" -> mergePolicyConfig.setPolicy(PutIfAbsentMergePolicy.class.getName());
            }
        }

        if (cluster.getCore().isReplicated()) {
            return new ReplicatedMapConfig()
                .setName(mapName)
                .setStatisticsEnabled(true)
                .setAsyncFillup(cluster.getCore().isAsyncFillup())
                .setInMemoryFormat(InMemoryFormat.BINARY)
                .setSplitBrainProtectionName(mapName.concat("-SplitBrainProtection"))
                .setMergePolicyConfig(mergePolicyConfig);
        }

        return new MapConfig()
            .setName(mapName)
            .setStatisticsEnabled(true)
            .setMergePolicyConfig(mergePolicyConfig)
            .setMaxIdleSeconds((int) timeoutSeconds)
            .setInMemoryFormat(InMemoryFormat.BINARY)
            .setBackupCount(cluster.getCore().getBackupCount())
            .setAsyncBackupCount(cluster.getCore().getAsyncBackupCount())
            .setEvictionConfig(evictionConfig);
    }
Build map config map config.

@param hz             the hz
@param mapName        the storage name
@param timeoutSeconds the timeoutSeconds
@return the map config
support/cas-server-support-hazelcast-core/src/main/java/org/apereo/cas/hz/HazelcastConfigurationFactory.java