filter

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

filter creates a collection with those elements that satisfy the predicate p and discarding the rest.