Creates a LinkedHashSet instance, with a high enough "initial capacity" that it should hold expectedSize elements without growth. This behavior cannot be broadly guaranteed, but it is observed to be true for OpenJDK 1.7. It also can't be guaranteed that the method isn't inadve
(int expectedSize)
| 328 | |
| 329 | |
| 330 | public static <E> LinkedHashSet<E> newLinkedHashSetWithExpectedSize(int expectedSize) { |
| 331 | return new LinkedHashSet<E>(Maps.capacity(expectedSize)); |
| 332 | } |
| 333 | |
| 334 | /** |
| 335 | * Creates a <i>mutable</i> {@code LinkedHashSet} instance containing the given elements in order. |