public function isResolvable($type)
    {
        if (!is_string($type)) {
            throw new InvalidArgumentException(
                'Can not check resolvable: type must be a string'
            );
        }

        $map = $this->map();
        if (isset($map[$type])) {
            $type = $map[$type];
        }

        if (class_exists($type)) {
            return true;
        }

        $resolver = $this->resolver();
        $resolved = $resolver($type);
        if (class_exists($resolved)) {
            return true;
        }

        return false;
    }