static Map filterMap(Map map, O f) { Map m2 = similarEmptyMap(map); for (A a : keys(map)) { B b = map.get(a); if (isTrue(callF(f, a))) m2.put(a, b); } ret m2; }