static A firstKeyWithValue(Map map, B value) { for (A key : keys(map)) if (eq(map.get(key), value)) ret key; null; } static A firstKeyWithValue(B value, Map map) { ret firstKeyWithValue(map, value); }