Collections.ensureMap = function(map) {
        if (!Class.doesExtend(map, Map)) {
            return new Map(map);
        } else {
            return /** @type {Map.<K, V>} */(map);