Java tutorial
//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(); if (!target.contains(element)) target.add(element); } } }