Here you can find the source of removeAllFromArrayList(ArrayList
private static <T> boolean removeAllFromArrayList(ArrayList<T> collection, Collection<?> toRemove)
//package com.java2s; import java.util.ArrayList; import java.util.Collection; public class Main { private static <T> boolean removeAllFromArrayList(ArrayList<T> collection, Collection<?> toRemove) { boolean result = false; for (int i = collection.size(); --i >= 0;) if (toRemove.contains(collection.get(i))) { collection.remove(i);//from w w w .j a va 2s . co m result = true; } return result; } }