public function buildTaskFromClass($task)
    {
        if (is_object($task) && $task instanceof AbstractTask) {
            return $task;
        }

        // Cancel if class doesn't exist
        if (!$class = $this->taskClassExists($task)) {
            throw new TaskCompositionException($task);
        }

        // Build class
        $class = new $class();
        if ($class instanceof ContainerAwareInterface) {
            $class->setContainer($this->container);
        }

        return $class;
    }