Here you can find the source of removeAll(Collection
public static void removeAll(Collection<Object> ret, Object[] elements)
//package com.java2s; //License from project: Open Source License import java.util.Collection; import java.util.Iterator; public class Main { public static void removeAll(Collection<Object> ret, Object[] elements) { if (elements != null) for (int i = 0; i < elements.length; i++) ret.remove(elements[i]); }/* ww w. j av a2 s.c o m*/ public static void removeAll(Collection<Object> ret, Iterator<Object> elements) { if (elements != null) while (elements.hasNext()) ret.remove(elements.next()); } }