code: public final V set(int index, K key, V value) {
      if (index < 0) {
        throw new IndexOutOfBoundsException();
      }
      int minSize = index + 1;
      ensureCapacity(minSize);
      int dataIndex = index << 1;
      V result = valueAtDataIndex(dataIndex + 1);
      setData(dataIndex, key, value);
      if (minSize > this.size) {
        this.size = minSize;
      }
      return result;
    }
docs: Sets the key/value mapping at the given index, overriding any existing key/value mapping.
  
  <p>There is no checking done to ensure that the key does not already exist. Therefore, this
  method is dangerous to call unless the caller can be certain the key does not already exist in
  the map.
  
  @return previous value or {@code null} for none
  @throws IndexOutOfBoundsException if index is negative