YamlEngine { public static Properties unmarshalProperties(final String yamlContent) { return Strings.isNullOrEmpty(yamlContent) ? new Properties() : new Yaml().loadAs(yamlContent, Properties.class); }  static T unmarshal(final File yamlFile, final Class<T> classType); static T unmarshal(final byte[] yamlBytes, final Class<T> classType); static T unmarshal(final String yamlContent, final Class<T> classType); static Map<?, ?> unmarshal(final String yamlContent); static Properties unmarshalProperties(final String yamlContent); static String marshal(final Object value);  }
@Test public void assertUnmarshalProperties() { Properties actual = YamlEngine.unmarshalProperties("password: pwd\nauthorizedSchemas: db1"); assertThat(actual.getProperty("authorizedSchemas"), is("db1")); assertThat(actual.getProperty("password"), is("pwd")); }