 <p>If you're using <a href="http://www.eclipse.org/collections/" rel="nofollow">Eclipse Collections</a> (formerly GS Collections), you can use the <code>partition</code> method on all <code>RichIterables</code>.</p> <pre><code>MutableList&lt;Integer&gt; integers = FastList.newListWith(-3, -2, -1, 0, 1, 2, 3); PartitionMutableList&lt;Integer&gt; result = integers.partition(IntegerPredicates.isEven()); Assert.assertEquals(FastList.newListWith(-2, 0, 2), result.getSelected()); Assert.assertEquals(FastList.newListWith(-3, -1, 1, 3), result.getRejected()); </code></pre> <p>The reason for using a custom type, <code>PartitionMutableList</code>, instead of <code>Pair</code> is to allow covariant return types for getSelected() and getRejected(). For example, partitioning a <code>MutableCollection</code> gives two collections instead of lists.</p> <pre><code>MutableCollection&lt;Integer&gt; integers = ...; PartitionMutableCollection&lt;Integer&gt; result = integers.partition(IntegerPredicates.isEven()); MutableCollection&lt;Integer&gt; selected = result.getSelected(); </code></pre> <p>If your collection isn't a <code>RichIterable</code>, you can still use the static utility in Eclipse Collections.</p> <pre><code>PartitionIterable&lt;Integer&gt; partitionIterable = Iterate.partition(integers, IntegerPredicates.isEven()); PartitionMutableList&lt;Integer&gt; partitionList = ListIterate.partition(integers, IntegerPredicates.isEven()); </code></pre> <p><strong>Note:</strong> I am a committer for Eclipse Collections.</p>