public static function make($namespace = null, $adapter = null)
    {
        $defaults = isset(static::$config['defaults'])
                  ? static::$config['defaults']
                  : [];

        if (! $adapter) {
            $adapter = isset($defaults['adapter'])
                     ? $defaults['adapter']
                     : static::DEFAULT_ADAPTER;
        }

        if (! isset(static::$config['adapters'][$adapter])) {
            throw new InvalidArgumentException(sprintf(
                'Unknown type adapter of cache "%s".',
                $adapter
            ));
        }
        $config = static::$config['adapters'][$adapter];
        $class  = $config['class'];

        $options = array_merge(
            isset($defaults['options']) ? (array) $defaults['options'] : [],
            isset($config['options'])   ? (array) $config['options']   : []
        );
        if (! $namespace) {
            $namespace = 'default';
        }
        $options['namespace'] = $namespace;

        $cache = new $class($options);
        if (! $cache instanceof AbstractCache) {
            throw new DomainException(sprintf(
                'The class "%s" of adapter "%s" must inherit '
                . 'an "Es\Cache\AbstractCache".',
                $class,
                $adapter
            ));
        }

        return $cache;
    }