public final class Collections extends Object
Collections.| Modifier and Type | Method and Description |
|---|---|
static <T> Collection<T> |
duplicatesFrom(Collection<T> c)
Returns any duplicate elements from the given
Collection. |
static String |
format(Collection<?> c)
Returns the
String standard representation of
the given Collection, or null if the given Collection is null. |
static String |
format(Collection<?> c,
String start,
String end)
Returns the
String standard representation of
the given Collection, or null if the given Collection is null. |
static String |
format(Representation p,
Collection<?> c)
Returns the
String representation of the given Collection, or null if the given
Collection is null. |
static String |
format(Representation p,
Collection<?> c,
String start,
String end)
Returns the
String representation of the given Collection, or null if the given
Collection is null. |
static boolean |
isNullOrEmpty(Collection<?> c)
Indicates whether the given
Collection is null or empty. |
static <T> List<T> |
nonNullElementsIn(Collection<T> c)
Returns all the non-
null elements in the given Collection. |
public static <T> Collection<T> duplicatesFrom(Collection<T> c)
Collection.T - the generic type of the given Collection.c - the given Collection that might have duplicate elements.Collection containing the duplicate elements of the given one. If no duplicates are found, an
empty Collection is returned.public static boolean isNullOrEmpty(Collection<?> c)
Collection is null or empty.c - the given Collection.true if the given Collection is null or empty, otherwise false.public static String format(Collection<?> c)
String standard representation of
the given Collection, or null if the given Collection is null.c - the Collection to format.String representation of the given Collection.public static String format(Representation p, Collection<?> c)
String representation of the given Collection, or null if the given
Collection is null.p - c - the Collection to format.String representation of the given Collection.public static String format(Collection<?> c, String start, String end)
String standard representation of
the given Collection, or null if the given Collection is null.c - the Collection to format.String representation of the given Collection.public static String format(Representation p, Collection<?> c, String start, String end)
String representation of the given Collection, or null if the given
Collection is null.p - c - the Collection to format.String representation of the given Collection.public static <T> List<T> nonNullElementsIn(Collection<T> c)
null elements in the given Collection.T - the type of elements of the Collection.c - the given Collection.null elements in the given Collection. An empty list is returned if the given
Collection is null.Copyright © 2013-2014 AssertJ. All Rights Reserved.