Java tutorial
//package com.java2s; import java.util.ArrayList; import java.util.Iterator; import java.util.List; public class Main { public static List getDifferenceOfTwoList(List originList, List targetList) { List diff = new ArrayList(); for (Iterator it = originList.iterator(); it.hasNext();) { Object obj = it.next(); if (!targetList.contains(obj)) { diff.add(obj); } } return diff; } }