title: Library method to partition a collection by a predicate
body: <p>I have a collection of objects that I would like to partition into two collections, one of which passes a predicate and one of which fails a predicate. I was hoping there would be a <a href="http://code.google.com/p/guava-libraries/" rel="nofollow noreferrer">Guava</a> method to do this, but the closest they come is <a href="https://google.github.io/guava/releases/23.0/api/docs/com/google/common/collect/Collections2.html#filter-java.util.Collection-com.google.common.base.Predicate-" rel="nofollow noreferrer">filter</a>, which doesn't give me the other collection.</p>
  
  <p>I would image the signature of the method would be something like this:</p>
  
  <pre><code>public static &lt;E&gt; Pair&lt;Collection&lt;E&gt;, Collection&lt;E&gt;&gt; partition(Collection&lt;E&gt; source, Predicate&lt;? super E&gt; predicate)
  </code></pre>
  
  <p>I realize this is super fast to code myself, but I'm looking for an existing library method that does what I want.</p>