public function addInstances(array $instances): self
    {
        foreach ($instances as $_key => $_instance) {
            if (is_string($_key)) {
                $_class_name = ltrim($_key, '\\');
            } else {
                $_class_name = get_class($_instance);
            }
            $_class_key                   = strtolower($_class_name);
            $this->instances[$_class_key] = $_instance; // Cache the instance.
        } // unset($_key, $_instance, $_class_name, $_class_key);

        return $this;
    }