Java Collection Union union(final Collection a, final Collection b)

Here you can find the source of union(final Collection a, final Collection b)

Description

union

License

Apache License

Declaration

public static <T> List<T> union(final Collection<T> a, final Collection<T> b) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.ArrayList;
import java.util.Collection;

import java.util.List;

public class Main {

    public static <T> List<T> union(final Collection<T> a, final Collection<T> b) {
        List<T> result = new ArrayList<T>(a);
        result.addAll(b);/*from   w  w w .j av a2  s.c  o  m*/
        return result;
    }
}

Related

  1. union(Collection lhs, Collection rhs)
  2. union(Collection set1, Collection set2)
  3. union(final Collection a, final Collection b)
  4. union(final Collection c1, final Collection c2)
  5. union(final Collection... sets)
  6. unionAll(final Collection collector, final T[] a, final T[] b)