Java tutorial
//package com.java2s; import java.util.Collection; import java.util.Iterator; import java.util.Map; public class Main { public static void removeKeys(Collection keys, Map map) { for (Iterator i = keys.iterator(); i.hasNext();) { Object key = (Object) i.next(); map.remove(key); } } }