takePercentage

fun <T> Collection<T>.takePercentage(percentage: Double): List<T>

Returns the first n percent of items out of the given Collection. The precentage gets rounded to the next integer regardless of the size of the returned List