Java tutorial
//package com.java2s; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; public class Main { public static <T> List<T> subtract(Collection<T> a, Collection<T> b) { ArrayList list = new ArrayList(a); Iterator i$ = b.iterator(); while (i$.hasNext()) { Object element = i$.next(); list.remove(element); } return list; } }