protected function getBundleInstances(
        KernelInterface $kernel,
        array $bundles
    ): array {
        $bundleStack = $this
            ->resolveAndReturnBundleDependencies(
                $kernel,
                $bundles
            );

        $builtBundles = [];
        foreach ($bundleStack as $bundle) {
            $builtBundles[] = $this
                ->getBundleDefinitionInstance($bundle);
        }

        return $builtBundles;
    }