title: Java 8 Streams - Nested Maps to List
body: <pre><code>firstlist
    .stream()
    .map( x -&gt; { 
              return secondList
                 .stream()
                 .map( y -&gt; { //return a string } )
                 .collect(Collectors.toList()) // "Output" I need
                }
         )
      .//Get the "Output" here
  </code></pre>
  
  <p>I have two list. the item in first list have to compared with second list and new list have to built.</p>
  
  <p><strong>Sample Input</strong></p>
  
  <pre><code>List 1 : [ { "id" ; 3, "names" : ["test","test2"] }]
  List 2 : [ {"name": :"test" , "age" :3}]
  </code></pre>
  
  <p><strong>Output:</strong></p>
  
  <pre><code>List 3 : [ {"id" : 3, "name" : "test", "age" :3} ]
  </code></pre>
  
  <p>P.S: The <code>names</code> in first list should be checked against second list</p>