object Strain { fun keep(collection: List, predicate: (T) -> Boolean): List { val filteredCollection = mutableListOf() collection.forEach { if (predicate(it)) filteredCollection.add(it) } return filteredCollection } fun discard(collection: List, predicate: (T) -> Boolean) = keep(collection, { value -> !predicate(value) }) }