function TreeNodes(tree, array, opts) {
      var _this;
      _classCallCheck(this, TreeNodes);
      _this = _callSuper(this, TreeNodes);
      if (isFunction(get(tree, 'isTree')) && !tree.isTree(tree)) {
        throw new TypeError('Invalid tree instance.');
      }
      Object.defineProperty(_assertThisInitialized(_this), '_tree', {
        value: tree,
        writable: true
      });
      _this.length = 0;
      _this.batching = 0;

      // A custom dirty flag to indicate when an index-altering
      // change has occured. Avoids re-caching when unnecessary.
      _this.indicesDirty = false;
      _this.config = defaultsDeep({}, opts, {
        calculateRenderablePositions: false
      });

      // Init pagination
      _this._pagination = {
        limit: tree.config.pagination.limit,
        total: 0
      };
      if (isArray(array) || array instanceof TreeNodes) {
        each(array, function (node) {
          if (node instanceof TreeNode) {
            _this.push(node.clone());
          } else {
            _this.addNode(node);
          }
        });
      }
      return _this;
    }
An Array-like collection of TreeNodes.

Note: Due to issue in many javascript environments,
native objects are problematic to extend correctly
so we mimic it, not actually extend it.

@param {InspireTree} tree Context tree.
@param {array} array Array of TreeNode objects.
@param {object} opts Configuration object.
@return {TreeNodes} Collection of TreeNode