title: Writing a YAML file using SnakeYAML
body: <p>I've been trying to create a method that combines values that I have into a Map that Yaml.load can read. So, for example:</p>
  
  <pre><code>Map&lt;String, Object&gt; map = new HashMap&lt;String, Object&gt;();
  map.put("example.key.abc", "test");
  map.put("example.key.def", "another test");
  map.put("example.test", "yet another test");
  map.put("example2.ex", "ex2");
  </code></pre>
  
  <p>And I want to turn this into a Map that Yaml can read. I've tried putting, for example, abc and def into a map with their values, and then putting that map into maps with other values. I can never seem to get this to work. Also, I want this to be able to work with any key, so just doing the maps manually won't work. This is the output that I would expect to get from the keys above if I could run a Map that was readable with Yaml through the rest of my code:</p>
  
  <pre><code>example:
    key:
      abc: test
      def: another test
    test: yet another test
  example2:
    ex: ex2
  </code></pre>
  
  <p>I just can't seem to make that method that can combine the Map that I have into a Map that Yaml can understand. Is there an API out there, or is this a just a really easy method to make that I just can't figure out? Any help is appreciated, thank you.</p>