filterTo

Appends all elements matching the given predicate to the given destination.

@IgnorableReturnValueinline fun <T, C : MutableCollection<in T>> Sequence<T>.filterTo(destination: C, predicate: (T) -> Boolean): C(source)
val numbers = sequenceOf(1, 2, 3, 4, 5)
val evens = mutableListOf<Int>()
numbers.filterTo(evens) { it % 2 == 0 }

Source