title: Set union and intersection using java streams
body: <p>I currently have a java program that uses nested for loops to compute the union and intersection of a list of set of integers. How to do this using java <em>parallel</em> streams ? The code i have currently is as follows</p>
  
  <pre><code>for(Set&lt;Integer&gt; x : listA) {
    for (Set&lt;Integer&gt; y : listB) {
         Set u = Sets.union(x,y); // Uses Guava library
         Set i = Sets.intersection(x,y);
    }
  }
  </code></pre>
  
  <p>I would like to make this fast as listA and listB are large.</p>