UiMap = function(map = undefined) {
  /** @private @const {!Map<K, V>} */
  this.map_ = new Map();

  const argLength = arguments.length;

  if (argLength > 1) {
    if (argLength % 2) {
      throw new Error('Uneven number of arguments');
    }
    for (let i = 0; i < argLength; i += 2) {
      this.set(arguments[i], arguments[i + 1]);
    }
  } else if (map) {
    this.addAll(/** @type {!Object} */ (map));
  }
}
Class for Hash Map datastructure.
@param {*=} map Map or Object to initialize the map with.
@constructor
@template K, V