static Map nullIfContainsKeysOtherThan(Map map, Set allowedKeys) { ret containsAnyKeyExcept(map, allowedKeys) ? null : map; }