protected function _appendExtensionsToPaths(array $paths, array $extensions)
    {
        $getPathsWithExtensions = function($path) use($extensions) {
            if ($this->_hasExtension($path)) {
                return [$path];
            }

            $addExtension = function($extension) use($path) {
                return $this->_addExtension($path, $extension);
            };

            return array_map($addExtension, $extensions);
        };

        return call_user_func_array('array_merge', array_map($getPathsWithExtensions, $paths));
    }