insertAll(heap) {
        let keys, values;
        if (heap instanceof $.PriorityQueue) {
            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++) {
                    const node = new Node(keys[i], values[i]);
                    node.index = nodes.length;
                    nodes.push(node);
                }
                return;
            }
        } else {
            throw "insertAll supports only OpenSeadragon.PriorityQueue object!";
        }

        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 {?OpenSeadragon.PriorityQueue} heap Object containing the data to add.