function equals(map, otherMap, valueEqualityFn = defaultEqualityFn) {
  if (map === otherMap) return true;
  if (map.size !== otherMap.size) return false;
  for (const key of map.keys()) {
    if (!otherMap.has(key)) return false;
    if (!valueEqualityFn(map.get(key), otherMap.get(key))) return false;
  }
  return true;
}
Compares two maps using their public APIs to determine if they have
equal contents, optionally using a custom comparison function when comaring
values.
@param {!MapLike<K,V1>} map The first map
@param {!MapLike<K,V2>} otherMap The other map
@param {(function(V1,V2): boolean)=} valueEqualityFn The comparison function
    used to determine if the values obtained from each map are equivalent. If
    no function is provided, defaults to strict equality (===).
@return {boolean}
@template K,V1,V2