Java tutorial
//package com.java2s; import java.util.ArrayList; import java.util.Collection; public class Main { final public static <T> Collection<T> nonMatched(Collection<T> tested, Collection<T> sources) { Collection<T> nonMatched = new ArrayList<T>(); for (T source : sources) { if (!tested.contains(source)) { nonMatched.add(source); } } return nonMatched; } }