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, b))) m2.put(a, b); } ret m2; } static Map filterMap(O f, Map map) { ret filterMap(map, f); } static Map filterMap(Map map, IF2 f) { ret filterMap(f, map); }