public inline fun <T> Iterable<T>.count(predicate: (T) -> Boolean): Int {
var count = 0
for (element in this) if (predicate(element)) count++
return count
}
val list = listOf(1, 2, 3, 4, 5)
println(list.count{ it > 3 }) // 2
println(list.count{ it > 0 }) // 5
println(list.count{ it > 5 }) // 0