Creates a <i>mutable</i>, initially empty {@code HashSet} instance. <p><b>Note:</b> if mutability is not required, use {@link ImmutableSet#of()} instead. If {@code E} is an {@link Enum} type, use {@link EnumSet#noneOf} instead. Otherwise, strongly consider using a {@code LinkedHashSet} instead, at
()
| 180 | * syntax</a>. |
| 181 | */ |
| 182 | @SuppressWarnings("NonApiType") // acts as a direct substitute for a constructor call |
| 183 | public static <E extends @Nullable Object> HashSet<E> newHashSet() { |
| 184 | return new HashSet<>(); |
| 185 | } |
| 186 | |
| 187 | /** |
| 188 | * Creates a <i>mutable</i> {@code HashSet} instance initially containing the given elements. |