public function set(string $key, $value): void
    {
        if (isset($this->data[$key])) {
            unset($this->data[$key]);
        } else {
            if ($this->size >= $this->maxSize) {
                \reset($this->data);
                unset($this->data[\key($this->data)]);
            } else {
                $this->size++;
            }
        }
        
        $this->data[$key] = $value;
    }