title: concurrent modification exception while iterating list map string object and edit key
body: <p>I'm putting in a <code>List&lt;Map&lt;String, Object&gt;&gt;</code> the result of a query along with the column names. Sometimes column names are like <code>TableAlias.ColumnName</code>, in that case I want to change it to just <code>ColumnName</code> and remove <code>TableAlias.</code> for that I have below code:</p>
  
  <pre><code>queryResult = namedParameterJdbcTemplateHive.queryForList(query, paramSource);
  
  for (Map&lt;String, Object&gt; map : queryResult) {
      for (Map.Entry&lt;String, Object&gt; entry : map.entrySet()) {            
          String[] keyData = entry.getKey().split("\\.");
          if (keyData.length &gt; 0) {
              Object obj = map.remove(entry.getKey());
              map.put(keyData[1], obj);
          }                   
      }
  }
  </code></pre>
  
  <p>That is giving me <code>concurrent modification exception</code> so I was trying with an iterator like below:</p>
  
  <pre><code>for (Map&lt;String, Object&gt; map : queryResult) {
      for(Iterator&lt;Map.Entry&lt;String, Object&gt;&gt; it = map.entrySet().iterator(); it.hasNext(); ) {
          Map.Entry&lt;String, Object&gt; entry = it.next();
          String[] keyData = entry.getKey().split("\\.");
          if (keyData.length &gt; 0) {
              it.remove();                        
          }
      }
  }
  </code></pre>
  
  <p>But not sure how to add the item back with the new key.</p>
  
  <p>Any suggestions please?</p>