title: get key and value from HashMap within ArrayList
body: <p>I have a file that i get all the data and separate it into a HashMap.
  The file looks something like this below.</p>
  
  <p>Before the <code>:</code> is the <code>key</code> and after is the <code>value</code></p>
  
  <pre><code>key1: 1
  key2: 2
  key3: 3
  </code></pre>
  
  <p>this is the code that puts the file data into the map ArrayList:</p>
  
  <pre class="lang-java prettyprint-override"><code>protected List&lt;Map&lt;String, String&gt;&gt; yaml_parse(BufferedReader filename) throws IOException{
  
      String result;
      List&lt;Map&lt;String, String&gt;&gt; list = new ArrayList&lt;Map&lt;String, String&gt;&gt;();
      while ((result = filename.readLine()) != null) {
          Map&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
          String key = result.substring(0, result.indexOf(":"));
          String value = result.substring(result.lastIndexOf(":") + 2);
          map.put(key, value);
          list.add(map);
      }
  
      return list;
  }
  </code></pre>
  
  <p>in another class where i call the function and println, this is the output</p>
  
  <pre><code>[{key1=1}, {key2=2}, {key3=3}]
  </code></pre>
  
  <p>So my Main question is, how do i get <code>key1</code> and have it return its value?</p>