MCPcopy
hub / github.com/google/guava / newHashSet

Method newHashSet

guava/src/com/google/common/collect/Sets.java:182–185  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

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.

Calls 4

addAllMethod · 0.95
addAllMethod · 0.65
iteratorMethod · 0.65