I have a Java Map. I want to interact with it as a squence/iterable/stream/whatever but I want to assert that only non-null values are in it in a non-exceptional way by filtering out any nulls (I don't trust the datasource). Is there a better way to do this than
myMap
.filterKeys { it != null }
.filterValues { it != null }
.map { MapEntry(it.key, it.value) }