@Override
    public Map<String, String> toMap() {
        synchronized (this.confData) {
            Map<String, String> ret =
                    CollectionUtil.newHashMapWithExpectedSize(this.confData.size());
            for (Map.Entry<String, Object> entry : confData.entrySet()) {
                ret.put(
                        entry.getKey(),
                        ConfigurationUtils.convertToString(entry.getValue(), standardYaml));
            }
            return ret;
        }
    }
@TestTemplate
    void testToMap() {
        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);

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