No, there's no way to do this; Stream
only works with a single element type. There's no way around the getKey
and getValue
approach.
(Streaming over the keys and calling get
doesn't actually seem to be any better from your perspective, and it's likely to be strictly less efficient.)