title: How to iterate over map using mustache in java
body: <p>I'm newbie to mustache and was wondering how to iterate over <code>HashMap</code> using mustache given this <code>Map</code></p>
  
  <pre><code>Map mapA = new HashMap();
  
  mapA.put("key1", "element 1");
  mapA.put("key2", "element 2");
  mapA.put("key3", "element 3");
  </code></pre>
  
  <p>The map key names vary. Ideally, I want mustache to iterate over both its key and values. So in java it will look like this:</p>
  
  <pre><code>for (Map.Entry&lt;String, Object&gt; entry : mapA.entrySet()) {
     String key = entry.getKey();
     String value = entry.getValue();
     // ...
  } 
  </code></pre>
  
  <p>So can someone tell me how to achieve above in mustache. I mean how would the template looks like? I tried this template but had no luck so far :(</p>
  
  <pre><code>{{#mapA}}
    &lt;li&gt;{{key}}&lt;/li&gt;
    &lt;li&gt;{{value}}&lt;/li&gt;
  {{/mapA&gt;
  </code></pre>
  
  <p>So when I run this template, the output <code>&lt;li&gt;</code> tags comes out empty, why?
  Thanks. </p>