Class ListBuilders
java.lang.Object
nl.jqno.equalsverifier.internal.util.ListBuilders
Helper functions for building lists with examples.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> List<T>
buildListOfAtLeastOne
(T first, T... more) Builds a list with at least one example.static <T> List<T>
buildListOfAtLeastTwo
(T first, T second, T... more) Builds a list with at least two examples.static <T> List<T>
fromIterable
(Iterable<T> iterable) Builds a list from the elements of an Iterable.static <T> boolean
listContainsDuplicates
(List<T> list) Determines whether a list contains the same example more than once.
-
Method Details
-
buildListOfAtLeastOne
Builds a list with at least one example.- Type Parameters:
T
- The type of example.- Parameters:
first
- The first example.more
- Zero or more additional examples.- Returns:
- A list with at least one example.
-
buildListOfAtLeastTwo
Builds a list with at least two examples.- Type Parameters:
T
- The type of example.- Parameters:
first
- The first example.second
- The second example.more
- Zero or more additional examples.- Returns:
- A list with at least two examples.
-
fromIterable
Builds a list from the elements of an Iterable.- Type Parameters:
T
- The type of the elements.- Parameters:
iterable
- The iterable containing the elements.- Returns:
- A list with the elements of the Iterable.
-
listContainsDuplicates
Determines whether a list contains the same example more than once.- Type Parameters:
T
- The type of example.- Parameters:
list
- The list that may or may not contain duplicates.- Returns:
- Whether the given list contains duplicates.
-