insertAll(heap) {
    let keys, values;
    if (heap instanceof Heap) {
      keys = heap.getKeys();
      values = heap.getValues();

      // If it is a heap and the current heap is empty, I can rely on the fact
      // that the keys/values are in the correct order to put in the underlying
      // structure.
      if (this.getCount() <= 0) {
        const nodes = this.nodes_;
        for (let i = 0; i < keys.length; i++) {
          nodes.push(new Node(keys[i], values[i]));
        }
        return;
      }
    } else {
      keys = object.getKeys(heap);
      values = object.getValues(heap);
    }

    for (let i = 0; i < keys.length; i++) {
      this.insert(keys[i], values[i]);
    }
  }
Adds multiple key-value pairs from another Heap or Object
@param {?Heap|?Object} heap Object containing the data to add.