private function resolve(Definition $definition)
    {
        if(!$this->container->isFrozen()) {
            throw new \LogicException("cannot use create method on factory without freezing/compiling container");
        }
        $subContainer = new ContainerBuilder();
        $subContainer->merge($this->container);
        $subContainer->setDefinition("__tmp__", $definition);
        $subContainer->compile();
        $obj = $subContainer->get("__tmp__");
        return $obj;
    }