title: How to cross join multiple Lists in Java?
body: <p>Cross Join concept is the same as database cross join. I have multiple lists lets say 3 to start with and I have to join the lists as below:</p>
  
  <pre><code>List&lt;E&gt; l1: {a, b},
  List&lt;E&gt; l2: {c, d},
  List&lt;E&gt; l3: {e, f},
  </code></pre>
  
  <p>Cross join should produce:</p>
  
  <pre><code>List&lt;E&gt; l4 = {a, c, f},
  List&lt;E&gt; l5 = {a, c, e},
  List&lt;E&gt; l6 = {a, d, f},
  List&lt;E&gt; l7 = {a, d, e},
  List&lt;E&gt; l8 = {b, c, f},
  List&lt;E&gt; l9 = {b, c, e},
  List&lt;E&gt; l10 = {b, d, f},
  List&lt;E&gt; l11= {b, d, e};
  </code></pre>
  
  <p>3 Lists with 3 elements each will give 27 new lists. And number of elements in each list is same, always.</p>
  
  <p>Now one possible solution is to iterate with three for loops and then add to 3 new lists.
  Is there any other possible way to achieve this so that complexity is lower?</p>
  
  <p>Thanks</p>