Returns the expected number of distinct elements given the specified elements. The number of distinct elements is only computed if elements is an instance of Multiset; otherwise the default value of 11 is returned.
(Iterable<?> elements)
| 380 | */ |
| 381 | |
| 382 | static int inferDistinctElements(Iterable<?> elements) { |
| 383 | if (elements instanceof Multiset) { |
| 384 | return ((Multiset<?>) elements).elementSet().size(); |
| 385 | } |
| 386 | return 11; // initial capacity will be rounded up to 16 |
| 387 | } |
| 388 | |
| 389 | /** |
| 390 | * Returns an unmodifiable view of the union of two multisets. |
no test coverage detected