guava
guava copied to clipboard
DO NOT MERGE
trafficstars
DO NOT MERGE
Demo of Guava changes for https://github.com/openjdk/jdk/pull/23461.
This change pre-sizes collectors for which the size of the output collection must match the size of the input stream. It omits cases like ImmutableSet (which deduplicates), but it includes cases ImmutableList (obviously) and ImmutableMap/ImmutableBiMap (which rejects duplicate keys).
RELNOTES=collect: Changed toImmutableList, toImmutableMap, and toImmutableBiMap to internally pre-size their collections when possible.