title: How to merge Stream<Map<String, Map<String, String>>> into a single Map<String, Map<String, String>>?
body: <p>I am trying to merge a <code>Stream&lt;Map&lt;String, Map&lt;String, String&gt;&gt;&gt;</code> object into a single map with keys in all the <code>Streams</code>.</p>
  
  <p>For example,</p>
  
  <pre><code>final Map&lt;String, someOtherObjectToProcess&gt; someObject;
  
  final List&lt;Map&lt;String, Map&lt;String, String&gt;&gt;&gt; list = someObject.entrySet()
              .stream()
              .flatMap(this::getInfoStream)
              .collect(Collectors.toList());
  </code></pre>
  
  <p>The signature for getInfoStream is</p>
  
  <pre><code>public Stream&lt;Map&lt;String, Map&lt;String, String&gt;&gt;&gt; getInfoStream(Map.Entry&lt;String, someOtherObjectToProcess&gt; entry)
  </code></pre>
  
  <p>if I use <code>(Collectors.toList())</code> I am able to get a list of these Map objects.</p>
  
  <p>Sample output if I use the above code:</p>
  
  <pre><code>[{
      "name" : {
          "property":"value"
      }
  },
  
  {
      "name2" : {
          "property":"value"
      }
  }]
  </code></pre>
  
  <p>But I want to collect into a Map with the structure</p>
  
  <pre><code>{
      "name" : {
          "property":"value"
      },
      "name2" : {
          "property":"value"
      }
  }
  </code></pre>
  
  <p>Provided that the keys will be unique.</p>
  
  <p><strong>How can I do this with Collectors.toMap() or any other alternative way?</strong></p>