Package org.assertj.core.util
Class Sets
java.lang.Object
org.assertj.core.util.Sets
Utility methods related to
Set
s.- Author:
- Alex Ruiz
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> HashSet<T>
Creates a mutableHashSet
.static <T> HashSet<T>
newHashSet
(Iterable<? extends T> elements) Creates a mutableHashSet
containing the given elements.static <T> LinkedHashSet<T>
Creates a mutableLinkedHashSet
.static <T> LinkedHashSet<T>
newLinkedHashSet
(T... elements) Creates a mutableLinkedHashSet
containing the given elements.static <T> TreeSet<T>
Creates a mutableTreeSet
.static <T> TreeSet<T>
newTreeSet
(T... elements) Creates a mutableTreeSet
containing the given elements.static <T> Set<T>
set
(T... elements) Creates a mutableHashSet
containing the given elements.
-
Method Details
-
set
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
.
-
newHashSet
Creates a mutableHashSet
.- Type Parameters:
T
- the generic type of theHashSet
to create.- Returns:
- the created
HashSet
.
-
newHashSet
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
Creates a mutableLinkedHashSet
.- Type Parameters:
T
- the generic type of theLinkedHashSet
to create.- Returns:
- the created
LinkedHashSet
.
-
newLinkedHashSet
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
Creates a mutableTreeSet
. -
newTreeSet
Creates a mutableTreeSet
containing the given elements.
-