takeIfNotEmpty

fun <T, C : Collection<T>> C.takeIfNotEmpty(): C?