title: Classical set operations for java.util.Collection
body: <p>Is there any built-in functionality for classical set operations on the java.util.Collection class? My specific implementation would be for ArrayList, but this sounds like something that should apply for all subclasses of Collection. I'm looking for something like:</p>
  
  <pre><code>ArrayList&lt;Integer&gt; setA ...
  ArrayList&lt;Integer&gt; setB ...
  ArrayList&lt;Integer&gt; setAintersectionB = setA.intersection(setB);
  ArrayList&lt;Integer&gt; setAminusB = setA.subtract(setB);
  </code></pre>
  
  <p>After some searching, I was only able to find home-grown solutions. Also, I realize I may be confusing the idea of a "Set" with the idea of a "Collection", not allowing and allowing duplicates respectively. Perhaps this is really just functionality for the Set interface?</p>
  
  <p>In the event that nobody knows of any built-in functionality, perhaps we could use this as a repository for standard practice Java set operation code? I imagine this wheel has been reinvented numerous times.</p>