public static synchronized <T> T convertToObject(String value, Class<T> type) {
        try {
            return type.cast(loader.loadFromString(value));
        } catch (MarkedYamlEngineException exception) {
            throw wrapExceptionToHiddenSensitiveData(exception);
        }
    }
@Test
    void testConvertToObject() {
        String s1 = "test";
        assertThat(YamlParserUtils.convertToObject(s1, String.class)).isEqualTo(s1);

        String s2 = "true";
        assertThat(YamlParserUtils.convertToObject(s2, Boolean.class)).isTrue();

        String s3 = "[a, b, c]";
        assertThat(YamlParserUtils.convertToObject(s3, List.class))
                .isEqualTo(Arrays.asList("a", "b", "c"));

        String s4 = "{k1: v1, k2: v2}";
        Map<String, String> map = new HashMap<>();
        map.put("k1", "v1");
        map.put("k2", "v2");

        assertThat(YamlParserUtils.convertToObject(s4, Map.class)).isEqualTo(map);
    }