protected function resolve($class)
    {
        if (class_exists($class) === false) {
            $message = 'Job ' . $class . ' is not found.';

            $this->log('error', $message);

            throw new JobNotFoundException($message);
        } elseif (is_subclass_of($class, 'Indigo\\Queue\\Job\\JobInterface') === false) {
            throw new InvalidJobException($class . 'is not a subclass of Indigo\\Queue\\Job\\JobInterface');
        }

        $job = new $class;

        if (isset($job->config)) {
            $this->config = array_merge($this->config, $job->config);
        }

        return $job;
    }