Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.Collection; import java.util.HashSet; import java.util.Set; public class Main { public static <T> Set<T> difference(Collection<T> s1, Collection<T> s2) { Set<T> ns = new HashSet<T>(s1); ns.removeAll(s2); return ns; } }