### Question:
YamlUtil { public static String writeValueAsString(Object value) { try { return mapper.writeValueAsString(value); } catch (JsonProcessingException jpe) { throw new YamlWriteException(jpe); } } private  YamlUtil(); static T load(final URL resource, final Class<T> clazz); static T load(final URL resource, final TypeReference<T> typeReference); static T load(final InputStream resource, final Class<T> clazz); static T load(final InputStream resource, final TypeReference<T> typeReference); static T load(final String content, final Class<T> clazz); static T load(final String content, final TypeReference<T> typeReference); static List<T> loadList(final URL resource, final Class<T> clazz); static List<T> loadList(final URL resource, final TypeReference<T> typeReference); static List<T> loadList(final InputStream resource, final Class<T> clazz); static List<T> loadList(
      final InputStream resource, final TypeReference<T> typeReference); static List<T> loadList(final String content, final Class<T> clazz); static List<T> loadList(final String content, final TypeReference<T> typeReference); static String writeValueAsString(Object value);  }### Answer:
@Test public void testWriteValueAsString() { TestBean2 tb = new TestBean2(); tb.setAttribute("attribute1"); tb.setMessage("Hello"); String actual = YamlUtil.writeValueAsString(tb); assertThat(actual).isEqualTo("---\nmessage: \"Hello\"\nattribute: \"attribute1\"\nid: null\n"); }