public function insert($filter, $priority)
	{
		if ( ! $filter instanceof FilterInterface)
		{
			throw new \InvalidArgumentException('The filter must be an instance of FilterInterface.');
		}
		
		if ($filter instanceof FilterChainInterface)
		{
			parent::insert($filter, [-$priority, $this->serial--]);
		}
		else
		{
			if ($this->isEmpty())
			{
				parent::insert(new FilterChain(), [0, $this->serial--]);
			}
			
			$this->top()->addFilter($filter, $priority);
		}
		
		return $this;
	}