Android examples for java.util:Collection Union
Union set to Collection
//package com.book2s; import java.util.Collection; import java.util.Set; public class Main { public static <T> Set<T> unionTo(Set<T> dest, Collection<T> src) { for (T object : src) { if (!dest.contains(object)) { dest.add(object);//www.j a va2 s . co m } } return dest; } }