code: public function insertAt($index, Token $token)
      {
          $this->setSize($this->getSize() + 1);
  
          for ($i = $this->getSize() - 1; $i > $index; --$i) {
              $this[$i] = isset($this[$i - 1]) ? $this[$i - 1] : new Token();
          }
  
          $this[$index] = $token;
      }
docs: Inserts a token at the given index.
  
  @param int   $index
  @param Token $token