title: groovy inject map with other map
body: <pre><code>    Map&lt;Integer, Map&lt;String, String&gt;&gt; Actions =  new HashMap&lt;Integer, Map&lt;String, String&gt;&gt;();
      Map&lt;Integer, List&lt;ActionName&gt;&gt; actionList = Service.getAvailableActionsById(order.id, user.id)
  
      for(Map.Entry&lt;Integer, List&lt;ActionName&gt;&gt; entry : actionList)
      {
        Map&lt;String, String&gt; actionMap = new HashMap&lt;String, String&gt;();
        for(ActionName actionName: entry.getValue()){
          actionMap.put(actionName.name(), actionName.name());
        }
        Actions.put(entry.getKey(), actionMap);
      }
  </code></pre>
  
  <p>--==//   For the same functionality above I want to use map inject, while doing as below it unable to inject all the list values to map</p>
  
  <pre><code> Map&lt;Integer, List&lt;ActionName&gt;&gt; actionList = [:]
      if ( order.id) actionList = Service.getAvailableActionsById(order.id, session.user.id)
  
      Map Actions = actionList.inject( [:] ) { map, id, values -&gt; map.put( id, values ); return map;  }
  </code></pre>
  
  <p>--=====</p>