Java Collection Union union(Collection lhs, Collection rhs)

Here you can find the source of union(Collection lhs, Collection rhs)

Description

union

License

Open Source License

Declaration

public static <T> Set<T> union(Collection<T> lhs, Collection<T> rhs) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    public static <T> Set<T> union(Collection<T> lhs, Collection<T> rhs) {
        HashSet<T> results = new HashSet<>(lhs.size() + rhs.size());
        results.addAll(lhs);/* ww  w . j  a  va2  s . co m*/
        results.addAll(rhs);
        return results;
    }
}

Related

  1. union(Collection c1, Collection c2)
  2. union(Collection> sets)
  3. union(Collection a, Collection b)
  4. union(Collection c1, Collection c2)
  5. union(Collection initial, Collection other)
  6. union(Collection set1, Collection set2)
  7. union(final Collection a, final Collection b)
  8. union(final Collection c1, final Collection c2)
  9. union(final Collection... sets)