@param $key
@param $element

@return MapIndex
968172
public function add($key, $element): self
    {
        $callback = $this->callback;

        $this->index[$callback($element)] = $key;

        return $this;
    }
501125
public function get($key)
    {
        if ($this->isValidKey($key)) {
            if ($this->hasIndex($key)) {
                return $this->_map[$key];
            }
        } else {
            throw new MapException('try to access with invalid map key.', E_NOTICE);
        }
        return null;
    }
184236
public function remove($key) {
        $value = $this->elements[$this->hash($key)];
        unset($this->elements[$this->hash($key)]);
        $this->fire(new MapRemoveEvent($key, $value));
        return $value;
    }
680736
public T get(final int key) {
		int index = ((key & 0x7FFFFFFF) % elementKeys.length);

		long m = elementKeys[index];
		if (key == m) {
			return elementValues[index];
		}

		return null;
	}
1160528
protected function getIndex($key)
    {
        $index = array_search($key, $this->keys, true);

        if ($index === false) {
            throw new \InvalidArgumentException("Index not found in map keys");
        }

        return $index;
    }
585147
public function offsetGet($key)
    {
        if (!\is_int($key)) {
            throw new \BadMethodCallException('Attempting to access node list with non-integer');
        }

        if (isset($this->nodes[$key])) {
            return $this->createChildInstance($this->nodes[$key]);
        }

        return $this->createChildInstance();
    }
683361
protected function getElem($key, ...$additionalKeys)
	{
		$el = $this->configElem($key, Html::el());

		foreach ($additionalKeys as $additionalKey) {
			$config = $this->fetchConfig($additionalKey);
			$el = $this->configElem($config, $el);
		}

		return $el;
	}
914742
public static function mapList( $list, $map, ?string $key = null ): array {

    if( !static::is( $list, true ) ) throw new \TypeError( 'The $list must be iterable' );
    else {

      $_list = [];
      foreach( $list as $index => $item ) {

        if( !static::is( $item, false, true ) ) throw new \TypeError( 'All $list element must be arraylike' );
        else {

          $_key = $key ? $item[ $key ] : $index;
          if( !static::is( $map, true, true ) ) $_list[ $_key ] = $item[ $map ] ?? null;
          else $_list[ $_key ] = static::map( $item, [], $map );
        }
      }

      return $_list;
    }
  }
1252801
public function extract($element, $withKey = null)
    {
        return new static(Utils\CollectionKeyWalker::extract($this, $element, $withKey));
    }
545923
public function set($index, $element)
    {
        if (null === $index) {
            $this->collections[] = $element;
        } else {
            $this->collections[$index] = $element;
        }

        return $this;
    }
70181
public function pressKey($key)
    {
        $this->executor->execute(DriverCommand::SEND_KEYS_TO_ACTIVE_ELEMENT, [
            'value' => [(string) $key],
        ]);

        return $this;
    }
443033
public function getIndexMap(string $indexKey = null)
    {
        if (null === $indexKey) {
            return $this->getEntries();
        }

        // Get storage keys for the objects.
        $index = [];
        foreach ($this->getEntries() as $key => $value) {
            $index[$key] = $value[$indexKey] ?? null;
        }

        return $index;
    }
346379
public function accumulate($element, $key)
    {
        $accumulate = $this->accumulator;
        $accumulate($this->structure, $element, $key);
    }
768685
protected function getMappedKeyIndex($mappedKey, $key)
    {
        $startSize = strlen($this->getStartMapDelimiter()) - 1;
        $key = substr($key, $startSize, strrpos($key, $this->getEndMapDelimiter())-$startSize);
        return substr($mappedKey, strlen($key . self::MAPPED_KEY_SEPARATOR));
    }
1079470
public function containsKey($key)
    {
        if ($key instanceof UniqueId) {
            $key = $key->id();
        }

        return $this->elements->containsKey($key);
    }
270355
private function getValueKeyFromObject($element, $key)
    {
        if (!$element instanceof \stdClass) {
            $getterName = 'get'.str_replace(' ', '', ucwords($key));

            return (method_exists($element, $getterName)) ? $element->$getterName() : false;
        }

        return (isset($element->{$key})) ? $element->{$key} : false;
    }
743723
public function set($index, $element)
    {
        if (!is_null($index)
            && is_scalar($index)
        ) {
            $this->_iterator = null;
            return $this->_items[$index] = $element;
        } else {
            // given index name is not valid
            throw new ListException('Element could not be added to list. Index is not valid.', E_NOTICE);
        }
    }