Here you can find the source of add_news(Collection
public static <T> void add_news(Collection<T> target, Collection<? extends T> to_add)
//package com.java2s; //License from project: Open Source License import java.util.Collection; import java.util.Iterator; public class Main { public static <T> void add_news(Collection<T> target, Collection<? extends T> to_add) { for (Iterator<? extends T> it = to_add.iterator(); it.hasNext();) { T element = it.next();/*from w w w .j av a2s . c o m*/ if (!target.contains(element)) target.add(element); } } }