flatMapValues

fun <K, A, B> Map<K, A>.flatMapValues(f: (Map.Entry<K, A>) -> Map<K, B>): Map<K, B>

Transform every Map.Entry of the original Map using f, only keeping the Map.Entry of the transformed map that match the input Map.Entry.