static A reverseLookup(Map map, B value) { if (map != null) for (A key : map.keySet()) if (eq(map.get(key), value)) ret key; ret null; }