Here you can find the source of subtract(final Collection
public static <T> List<T> subtract(final Collection<T> a, final Collection<T> b)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static <T> List<T> subtract(final Collection<T> a, final Collection<T> b) { List<T> list = new ArrayList<T>(a); for (T element : b) { list.remove(element);/* w w w .ja v a2 s.co m*/ } return list; } }