public function getApplicationRoot(): string
    {
        $corePackagePath = $this->getCorePackageRoot();
        $corePackageIsRootPackage = interface_exists('PhpList\\Core\\Tests\\Support\\Interfaces\\TestMarker');
        if ($corePackageIsRootPackage) {
            $applicationRoot = $corePackagePath;
        } else {
            // remove 3 more path segments, i.e., "vendor/phplist/core/"
            $corePackagePath = dirname($corePackagePath, 3);
            $applicationRoot = $corePackagePath;
        }

        if (!file_exists($applicationRoot . '/composer.json')) {
            throw new \RuntimeException(
                'There is no composer.json in the supposed application root "' . $applicationRoot . '".',
                1501169001
            );
        }

        return $applicationRoot;
    }