firstNotNullOrElse

inline fun <T> Iterable<T?>.firstNotNullOrElse(defaultValue: () -> T): T
inline fun <T> List<T?>.firstNotNullOrElse(defaultValue: () -> T): T

Returns the first element which is not null, or the result of calling the defaultValue function if there are no elements or all elements are null.