Here you can find the source of remove(Collection entityList1, Collection entityList2, Comparator comparator)
public static List remove(Collection entityList1, Collection entityList2, Comparator comparator)
//package com.java2s; /*/*from ww w . j a v a 2s . c o m*/ * Copyright (c) 2007 Agile-Works * All rights reserved. * * This software is the confidential and proprietary information of * Agile-Works. ("Confidential Information"). * You shall not disclose such Confidential Information and shall use * it only in accordance with the terms of the license agreement you * entered into with Agile-Works. */ import java.util.*; public class Main { public static List remove(Collection entityList1, Collection entityList2, Comparator comparator) { List result = new ArrayList(); for (Iterator iter1 = entityList1.iterator(); iter1.hasNext();) { Object o1 = iter1.next(); boolean containedOnList2 = false; for (Iterator iter2 = entityList2.iterator(); iter2.hasNext();) { Object o2 = iter2.next(); if (comparator.compare(o1, o2) == 0) { containedOnList2 = true; break; } } if (!containedOnList2) result.add(o1); } return result; } }