mapKeysNotNull

inline fun <K, V, R : Any> Map<K, V>.mapKeysNotNull(transform: (Map.Entry<K, V>) -> R?): Map<R, V>

Returns a map with each key replaced by the result of transform, dropping entries where it returns null.

Values are unchanged. When transform produces the same key for several entries, the value of the last one in iteration order wins.