public static synchronized String toYAMLString(Object value) {
        try {
            String output = flowDumper.dumpToString(value);
            // remove the line break
            String linebreak = flowDumperSettings.getBestLineBreak();
            if (output.endsWith(linebreak)) {
                output = output.substring(0, output.length() - linebreak.length());
            }
            return output;
        } catch (MarkedYamlEngineException exception) {
            throw wrapExceptionToHiddenSensitiveData(exception);
        }
    }
@Test
    void testToYAMLString() {
        assertThat(YamlParserUtils.toYAMLString(TestEnum.ENUM)).isEqualTo(TestEnum.ENUM.toString());

        Object o1 = 123;
        assertThat(YamlParserUtils.toYAMLString(o1)).isEqualTo(String.valueOf(o1));

        Object o2 = true;
        assertThat(YamlParserUtils.toYAMLString(o2)).isEqualTo(String.valueOf(o2));

        // the following value should be escaped
        Object o3 = Arrays.asList("*", "123", "true");
        assertThat(YamlParserUtils.toYAMLString(o3)).isEqualTo("['*', '123', 'true']");
    }