private function mergeAutoload(RootPackageInterface $root)
    {
        if ( ! empty($autoload = $this->getPackage()->getAutoload())) {
            static::unwrapIfNeeded($root, 'setAutoload')
                ->setAutoload(array_merge_recursive(
                    $root->getAutoload(), Util::fixRelativePaths($this->getPath(), $autoload)
                ));
        }
    }