Java Utililty Methods List Union

List of utility methods to do List Union

Description

The list of methods to do List Union are organized into topic(s).

Method

IterableshallowUnionCol(Collection> values)
shallow Union Col
return shallowUnion(new ArrayList<>(values).toArray(new List[] {}));
char[]union(final char[]... list)
union
StringBuilder sb = new StringBuilder();
for (char[] characters : list) {
    for (int i = 0; i < list.length; i++) {
        if (!contains(sb, characters[i])) {
            sb.append(list[i]);
char[] toReturn = new char[sb.length()];
sb.getChars(0, sb.length(), toReturn, 0);
Arrays.sort(toReturn);
return toReturn;
Listunion(final List list1, final List list2)
Returns a new list containing the second list appended to the first list.
final ArrayList result = new ArrayList(list1);
result.addAll(list2);
return result;
Listunion(final List list1, final List list2)
Returns a new list containing the second list appended to the first list.
final ArrayList result = new ArrayList(list1);
result.addAll(list2);
return result;
Listunion(final List list1, final List list2)
union
final List<E> result = new ArrayList<E>(list1.size() + list2.size());
result.addAll(list1);
result.addAll(list2);
return result;
Listunion(final List list1, final List list2)
union
if (list1 == null || list2 == null)
    throw new NullPointerException("Not initizalized lists");
List<E> concat = new ArrayList<E>(list1.size() + list2.size());
concat.addAll(list1);
E item;
ListIterator<E> iter = list1.listIterator();
while (iter.hasNext()) {
    item = iter.next();
...
Listunion(final List... lists)
Unions the given array of lists into a single list.
final List<T> union = new ArrayList<>();
for (List<T> list : lists) {
    union.addAll(list);
return union;
ListUnion(List A, List B)
Union
if (A == null)
    return B;
if (B == null)
    return A;
List list = new ArrayList(A);
for (Iterator i = B.iterator(); i.hasNext();) {
    Object o = i.next();
    if (!list.contains(o))
...
Listunion(List ls, List ls2)
union
List list = new ArrayList(Arrays.asList(new Object[ls.size()]));
Collections.copy(list, ls);
list.addAll(ls2);
return list;
byte[]union(List byteList)
union
int size = 0;
for (byte[] bs : byteList) {
    size += bs.length;
byte[] ret = new byte[size];
int pos = 0;
for (byte[] bs : byteList) {
    System.arraycopy(bs, 0, ret, pos, bs.length);
...