@Internal
    public Map<String, String> toFileWritableMap() {
        if (standardYaml) {
            synchronized (this.confData) {
                Map<String, String> ret =
                        CollectionUtil.newHashMapWithExpectedSize(this.confData.size());
                for (Map.Entry<String, Object> entry : confData.entrySet()) {
                    // Because some character in standard yaml should be escaped by quotes, such as
                    // '*', here we should wrap the value by Yaml pattern
                    ret.put(entry.getKey(), YamlParserUtils.toYAMLString(entry.getValue()));
                }
                return ret;
            }
        } else {
            return toMap();
        }
    }
@TestTemplate
    void testToFileWritableMap() {
        final Configuration configuration = new Configuration(standardYaml);
        final String listValues = "value1;value2;value3";
        final String yamlListValues = "[value1, value2, value3]";
        configuration.set(LIST_STRING_OPTION, Arrays.asList(listValues.split(";")));

        final String mapValues = "key1:value1,key2:value2";
        final String yamlMapValues = "{key1: value1, key2: value2}";
        configuration.set(
                MAP_OPTION,
                Arrays.stream(mapValues.split(","))
                        .collect(Collectors.toMap(e -> e.split(":")[0], e -> e.split(":")[1])));

        final Duration duration = Duration.ofMillis(3000);
        configuration.set(DURATION_OPTION, duration);

        final String strValues = "*";
        final String yamlStrValues = "'*'";
        configuration.set(STRING_OPTION, strValues);

        if (standardYaml) {
            assertThat(configuration.toFileWritableMap().get(LIST_STRING_OPTION.key()))
                    .isEqualTo(yamlListValues);
            assertThat(configuration.toFileWritableMap().get(MAP_OPTION.key()))
                    .isEqualTo(yamlMapValues);
            assertThat(configuration.toFileWritableMap().get(STRING_OPTION.key()))
                    .isEqualTo(yamlStrValues);
        } else {
            assertThat(configuration.toFileWritableMap().get(LIST_STRING_OPTION.key()))
                    .isEqualTo(listValues);
            assertThat(configuration.toFileWritableMap().get(MAP_OPTION.key()))
                    .isEqualTo(mapValues);
            assertThat(configuration.toFileWritableMap().get(STRING_OPTION.key()))
                    .isEqualTo(strValues);
        }
        assertThat(configuration.toMap().get(DURATION_OPTION.key())).isEqualTo("3 s");
    }