function HashedArrayTree(ArrayClass, initialCapacityOrOptions) {
  if (arguments.length < 1)
    throw new Error('mnemonist/hashed-array-tree: expecting at least a byte array constructor.');

  var initialCapacity = initialCapacityOrOptions || 0,
      blockSize = DEFAULT_BLOCK_SIZE,
      initialLength = 0;

  if (typeof initialCapacityOrOptions === 'object') {
    initialCapacity = initialCapacityOrOptions.initialCapacity || 0;
    initialLength = initialCapacityOrOptions.initialLength || 0;
    blockSize = initialCapacityOrOptions.blockSize || DEFAULT_BLOCK_SIZE;
  }

  if (!blockSize || !powerOfTwo(blockSize))
    throw new Error('mnemonist/hashed-array-tree: block size should be a power of two.');

  var capacity = Math.max(initialLength, initialCapacity),
      initialBlocks = Math.ceil(capacity / blockSize);

  this.ArrayClass = ArrayClass;
  this.length = initialLength;
  this.capacity = initialBlocks * blockSize;
  this.blockSize = blockSize;
  this.offsetMask = blockSize - 1;
  this.blockMask = Math.log2(blockSize);

  // Allocating initial blocks
  this.blocks = new Array(initialBlocks);

  for (var i = 0; i < initialBlocks; i++)
    this.blocks[i] = new this.ArrayClass(this.blockSize);
}
HashedArrayTree.

@constructor
@param {function}      ArrayClass           - An array constructor.
@param {number|object} initialCapacityOrOptions - Self-explanatory.