static void mapPutStrictlyOrFail(Map map, A key, B value) {
if (!(map != null && key != null && value != null)) ret;
B old = map.get(key);
if (old == null) { map.put(key, value); ret; }
if (eq(old, value)) ret;
fail("Can't overwrite key " + key + " (old value: " + old + ", new value: " + value);
}