lastNotNull

fun <T> Iterable<T?>.lastNotNull(): T
fun <T> List<T?>.lastNotNull(): T

Returns the last element which is not null.

Throws

if there are no elements or all elements are null.