title: Streams - Merge 2 Lists
body: <p>Issue faced on the way to merge 2 Lists using Streams. At present when I use the Stream.concat it is adding to the bottom of the list, which is not what I want.</p>
  
  <p><strong><em>List1:</em></strong></p>
  
  <ul>
  <li>[ABC, 123, 456] </li>
  <li>[DEF, 234, 567]</li>
  <li>[GHI, 345, 678]</li>
  </ul>
  
  <p><strong><em>List 2:</em></strong></p>
  
  <ul>
  <li>[ABC, 789, 012]</li>
  <li>[DEF, 890, 123]</li>
  <li>[GHI, 901, 234]</li>
  </ul>
  
  <p><strong><em>Ideal Merged Output:</em></strong></p>
  
  <ul>
  <li>[ABC, 123, 456, 789, 012]</li>
  <li>[DEF, 234, 567, 890, 123]</li>
  <li>[GHI, 345, 678, 901, 234]</li>
  </ul>
  
  <p>If the above is not possible, then below also acceptable</p>
  
  <ul>
  <li>[ABC, 123, 456, ABC, 789, 012]</li>
  <li>[DEF, 234, 567, DEF, 890, 123]</li>
  <li>[GHI, 345, 678, GHI, 901, 234]</li>
  </ul>
  
  <p>Output I am getting at present, which is not what i want</p>
  
  <ul>
  <li>[ABC, 123, 456] </li>
  <li>[DEF, 234, 567]</li>
  <li>[GHI, 345, 678]</li>
  <li>[ABC, 789, 012]</li>
  <li>[DEF, 890, 123]</li>
  <li>[GHI, 901, 234]</li>
  </ul>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>List&lt;List&lt;XSSFCell&gt;&gt; listData1 = list1.stream().skip(1).collect(Collectors.toList());
      List&lt;List&lt;XSSFCell&gt;&gt; listData2 = list2.stream().skip(1).collect(Collectors.toList());
  Stream stream = Stream.concat(listData1.stream(),listData2.stream());
  </code></pre>
  
  <p>Hope the issue I face is clear, await guidance.</p>
  
  <p><strong>Added</strong>
  This question has been marked as duplicate of this <a href="https://stackoverflow.com/questions/17640754/zipping-streams-using-jdk8-with-lambda-java-util-stream-streams-zip">question</a> But am unable to find StreamUtils.zip method which is mentioned in the solution. The first answer in that question, states take it at your own risk. Can this be done with the standard available libraries or can I know how I can get zip method in StreamUtils </p>