Android examples for java.lang:Math
Returns the union of two Integer lists.
//package com.java2s; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; public class Main { /**// w ww . j a v a 2s. c om * Returns the union of two Integer lists. * @param A * @param B * @return */ public static <T> List<T> union(List<T> A, List<T> B) { Set<T> set = new HashSet<T>(); set.addAll(A); set.addAll(B); return new ArrayList<T>(set); } }