public abstract class CollectionUtils extends Object
Modifier and Type | Method and Description |
---|---|
static <S,T extends Collection<S>> |
merge(T collection1,
T collection2,
Supplier<T> factoryMethod)
Merge two collections into a new collection instance.
|
public static <S,T extends Collection<S>> T merge(T collection1, T collection2, Supplier<T> factoryMethod)
factoryMethod
.
If any of the two inputs collections is null
or empty the other input collection is returned (even if
that one is null
as well).
S
- the type of elements in the collectionsT
- the type of collectioncollection1
- the first collectioncollection2
- the second collectionfactoryMethod
- function to initialize the new collectionCopyright © 2010–2017. All rights reserved.