Here you can find the source of removeAll(Map
public static <K, V> void removeAll(Map<K, V> map, Set<K> keys)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static <K, V> void removeAll(Map<K, V> map, Set<K> keys) { for (K k : keys) { map.remove(k);//from w w w . j av a 2 s.c om } } }