partition

trait Collection[A] {
  def partition(p: (A) => Boolean): (Collection[A], Collection[A])
}

partition creates two collections: one containing those elements that satisfy the predicate p and those which don’t, and returns them in a Tuple2.