mapWhileNotNull

inline fun <T> mapWhileNotNull(gen: (Int) -> T?): List<T>