public function addPsr4($prefix, $paths, $prepend = false)
    {
        if (!$prefix) {
            // Register directories for the root namespace.
            if ($prepend) {
                $this->_fallbackDirsPsr4 = array_merge(
                    (array) $paths,
                    $this->_fallbackDirsPsr4
                );
            } else {
                $this->_fallbackDirsPsr4 = array_merge(
                    $this->_fallbackDirsPsr4,
                    (array) $paths
                );
            }
        } elseif (!isset($this->_prefixDirsPsr4[$prefix])) {
            // Register directories for a new namespace.
            $length = strlen($prefix);
            if ('\\' !== $prefix[$length - 1]) {
                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
            }
            $this->_prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
            $this->_prefixDirsPsr4[$prefix] = (array) $paths;
        } elseif ($prepend) {
            // Prepend directories for an already registered namespace.
            $this->_prefixDirsPsr4[$prefix] = array_merge(
                (array) $paths,
                $this->_prefixDirsPsr4[$prefix]
            );
        } else {
            // Append directories for an already registered namespace.
            $this->_prefixDirsPsr4[$prefix] = array_merge(
                $this->_prefixDirsPsr4[$prefix],
                (array) $paths
            );
        }
    }