Here you can find the source of removeElementsFromList(List
public static <T> List<T> removeElementsFromList(List<T> inputList, List<T> elementsToRemove)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { public static <T> List<T> removeElementsFromList(List<T> inputList, List<T> elementsToRemove) { if (elementsToRemove == null) { return inputList; }/*from w w w.jav a 2 s .com*/ List<T> filteredList = new ArrayList<T>(inputList); for (Object objectToRemove : elementsToRemove) { for (int i = 0; i < filteredList.size(); i++) { if (filteredList.get(i).equals(objectToRemove)) { filteredList.remove(i); } } } return filteredList; } }