toCollection

fun <C : MutableCollection<in T>> toCollection(destination: C): C

Appends all elements to the given destination collection.

Return

the collection

Parameters

C

the type of the collection

destination

the destination collection