static void removeFromMapWhereValue(Map map, IPred pred) { if (map == null) ret; Iterator> i = map.entrySet().iterator(); while (i.hasNext()) { Map.Entry e = i.next(); if (pred.get(e.getValue())) i.remove(); } }