Package org.assertj.core.util
Class Sets
- java.lang.Object
-
- org.assertj.core.util.Sets
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Sets()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> HashSet<T>
newHashSet()
Creates a mutableHashSet
.static <T> HashSet<T>
newHashSet(Iterable<? extends T> elements)
Creates a mutableHashSet
containing the given elements.static <T> LinkedHashSet<T>
newLinkedHashSet()
Creates a mutableLinkedHashSet
.static <T> LinkedHashSet<T>
newLinkedHashSet(T... elements)
Creates a mutableLinkedHashSet
containing the given elements.static <T> TreeSet<T>
newTreeSet()
Creates a mutableTreeSet
.static <T> TreeSet<T>
newTreeSet(T... elements)
Creates a mutableTreeSet
containing the given elements.
-
-
-
Method Detail
-
newHashSet
public static <T> HashSet<T> newHashSet()
Creates a mutableHashSet
.- Type Parameters:
T
- the generic type of theHashSet
to create.- Returns:
- the created
HashSet
.
-
newHashSet
public static <T> HashSet<T> newHashSet(Iterable<? extends T> elements)
Creates a mutableHashSet
containing the given elements.- Type Parameters:
T
- the generic type of theHashSet
to create.- Parameters:
elements
- the elements to store in theHashSet
.- Returns:
- the created
HashSet
, ornull
if the given array of elements isnull
.
-
newLinkedHashSet
public static <T> LinkedHashSet<T> newLinkedHashSet()
Creates a mutableLinkedHashSet
.- Type Parameters:
T
- the generic type of theLinkedHashSet
to create.- Returns:
- the created
LinkedHashSet
.
-
newLinkedHashSet
@SafeVarargs public static <T> LinkedHashSet<T> newLinkedHashSet(T... elements)
Creates a mutableLinkedHashSet
containing the given elements.- Type Parameters:
T
- the generic type of theLinkedHashSet
to create.- Parameters:
elements
- the elements to store in theLinkedHashSet
.- Returns:
- the created
LinkedHashSet
, ornull
if the given array of elements isnull
.
-
newTreeSet
@SafeVarargs public static <T> TreeSet<T> newTreeSet(T... elements)
Creates a mutableTreeSet
containing the given elements.
-
-