protected function runTool(
        $targetBranch,
        bool $processIsolation,
        string $fullMessage,
        string $tool,
        string $diffMessage
    ) {
        if ($targetBranch === false || $this->environment->isLocalBranchEqualTo($targetBranch)) {
            $this->output->writeln($fullMessage, OutputInterface::VERBOSITY_NORMAL);
            $template = $this->commands[$tool . 'BL'];
            $exitCode = $this->genericCommandRunner->runBlacklistCommand(
                $template,
                $this->blacklistToken,
                $this->blacklistPrefix,
                $this->blacklistGlue,
                $this->escape
            );
        } else {
            $this->output->writeln($diffMessage, OutputInterface::VERBOSITY_NORMAL);
            $template = $this->commands[$tool . 'WL'];
            $exitCode = $this->genericCommandRunner->runWhitelistCommand(
                $template,
                $targetBranch,
                $this->blacklistToken,
                $this->filter,
                $processIsolation,
                $this->whitelistGlue
            );
        }

        return $exitCode;
    }