Filter a stream using a predicate