Java tutorial
//package com.java2s; import java.util.AbstractSet; import java.util.Collection; public class Main { private static boolean removeAllFromSet(AbstractSet<?> collection, Collection<?> toRemove) { boolean result = false; for (Object o : toRemove) result |= collection.remove(o); return result; } }