Here you can find the source of addAllIfNotContained(List dst, Collection src)
@SuppressWarnings("unchecked") public static void addAllIfNotContained(List dst, Collection src)
//package com.java2s; //License from project: Open Source License import java.util.Collection; import java.util.List; public class Main { @SuppressWarnings("unchecked") public static void addAllIfNotContained(List dst, Collection src) { for (Object object : src) { addIfNotContained(dst, object); }// w ww . j av a 2 s .c o m } @SuppressWarnings("unchecked") public static void addIfNotContained(List list, Object object) { if (!list.contains(object)) { list.add(object); } } }