title: Iterating over list of maps and transforming
body: <p>I am pretty much new to Scala and trying to learn some stuff and would like to understand the best possible approach on below:</p>
  
  <p>I have a list of maps as below.</p>
  
  <pre><code>List&lt;Map&lt;String,String&gt;&gt; listOfMaps = new ArrayList&lt;&gt;();
  Map&lt;String,String&gt; map1 = new HashMap&lt;&gt;();
  map1.put("a","A1");
  map1.put("b","B1");
  .
  .
  .
  map10.put("a","A10");
  map10.put("b","B10");
  
  listOfMaps.add(map1);
  listOfMaps.add(map2);
  ...
  listOfMaps.add(map10);
  </code></pre>
  
  <p>I would like to iterate this and transform in to another list with just a certain key, value pair from the map and add a new value</p>
  
  <pre><code>    List&lt;Map&lt;String,String&gt;&gt; newlistOfMaps = new ArrayList&lt;&gt;();
      for(Map map: listOfMaps) {
        Map&lt;String,String&gt; newMap = new HashMap&lt;&gt;();
        newMap.put("a_b", map.get("a")+"_"+map.get("b"));
        newListOfMaps.add(newMap);
      }
  
      System.out.println(newListOfMaps);
  </code></pre>
  
  <p>What is the best-practice to follow while doing this in Scala? Any help or suggestion would be great!</p>