protected function autoConnectToAvailableCacheSystem(
        CacheAdapterAutoManager $cacheAdapterManagerForAutoConnect = null,
        bool $cacheAdapterManagerForAutoConnectOverwrite = false
    ): iAdapter {
        static $AUTO_ADAPTER_STATIC_CACHE = null;

        if (
            \is_object($AUTO_ADAPTER_STATIC_CACHE)
            &&
            $AUTO_ADAPTER_STATIC_CACHE instanceof iAdapter
        ) {
            return $AUTO_ADAPTER_STATIC_CACHE;
        }

        // init
        $adapter = null;

        $cacheAdapterManagerDefault = CacheAdapterAutoManager::getDefaultsForAutoInit();

        if ($cacheAdapterManagerForAutoConnect !== null) {
            if ($cacheAdapterManagerForAutoConnectOverwrite) {
                $cacheAdapterManagerDefault = $cacheAdapterManagerForAutoConnect;
            } else {
                /** @noinspection PhpUnhandledExceptionInspection */
                $cacheAdapterManagerDefault->merge($cacheAdapterManagerForAutoConnect);
            }
        }

        foreach ($cacheAdapterManagerDefault->getAdapters() as $adapterTmp => $callableFunctionTmp) {

            /** @var iAdapter $adapterTest */
            if ($callableFunctionTmp !== null) {
                $adapterTest = new $adapterTmp($callableFunctionTmp);
            } else {
                $adapterTest = new $adapterTmp();
            }

            if ($adapterTest->installed()) {
                $adapter = $adapterTest;

                break;
            }
        }

        // save to static cache
        $AUTO_ADAPTER_STATIC_CACHE = $adapter;

        return $adapter;
    }