static A firstKeyWithValue(Map map, B value) { if (map != null) for (Map.Entry e : map.entrySet()) if (eq(e.getValue(), value)) ret e.getKey(); null; } static A firstKeyWithValue(B value, Map map) { ret firstKeyWithValue(map, value); }