protected function _prependPrefixToFilename($name)
    {
        $ds = DIRECTORY_SEPARATOR;
        $parts = explode($ds, $name);
        $filename = end($parts);

        if ($name === $filename
            || $filename[0] === $this->optionalDependencyPrefix) {
            return $this->optionalDependencyPrefix . $name;
        }

        return str_replace(
            $ds . $filename,
            $ds . $this->optionalDependencyPrefix . $filename,
            $name
        );
    }