Class Sets (1.44.2)

public final class Sets

Static utility methods pertaining to Set instances.

NOTE: this is a copy of a subset of Guava's com.google.common.collect.Sets. The implementation must match as closely as possible to Guava's implementation.

Inheritance

java.lang.Object > Sets

Static Methods

<E>newHashSet()

public static HashSet<E> <E>newHashSet()

Returns a new mutable, empty HashSet instance.

Returns
Type Description
HashSet<E>

<E>newTreeSet()

public static TreeSet<E> <E>newTreeSet()

Returns a new mutable, empty TreeSet instance sorted by the natural sort ordering of its elements.

Returns
Type Description
TreeSet<E>