title: Live Template fore Intellij IDEA for Iterating through Map
body: <p>We can iterate through collection easily by pressing <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>T</kbd>, <img src="https://i.stack.imgur.com/EjE8Q.png" alt=""></p>
  
  <p>And then I wanted to create such template for iterating through map:
  I wrote these lines to <em>template text</em> box:</p>
  
  <pre><code>for (Map.Entry&lt;$ELEMENT_TYPE$&gt; $VAR$ : $SELECTION$.entrySet()) {
    $END$
  }
  </code></pre>
  
  <p>Now it is generating these codes:</p>
  
  <pre><code> HashMap&lt;String,Object&gt; map=new HashMap&lt;String,Object&gt;();
      for (Map.Entry&lt;Object&gt; objectEntry : map.entrySet()) {
  
      }
  </code></pre>
  
  <p><code>Map.Entry&lt;Object&gt;</code> should be <code>Map.Entry&lt;String,Object&gt;</code>. I cannot find a way to introduce variable correctly. How can I do that?</p>