public function add($filename, FileInterface &$removed = null)
    {
        $this->initialize();

        $file = $this->matcher->getFile($filename);

        if (!$this->isStackable($file)) {
            throw new FileNotStackableException($file);
        }

        array_unshift($this->files, $file);

        if (count($this) > static::MAX_ITEMS) {
            $removed = array_pop($this->files);
        }

        $this->persist();

        return $file;
    }