private function getCallbackClassInstance()
    {
        // create and validate the instance
        $className = $this->getClassName();
        $instance = new $className();

        // check that the app implements the trait
        // is we use the class_traits method, we only get the traits of the current level, we don't get the traits
        // if the class extends another class that actually implements the trait
        if (!method_exists($instance, 'setAppInstance')) {
            if (!isset($traits[AppTrait::class])) {
                throw new BootstrapException('Class "' . $className . '" must use "' . AppTrait::class . '" trait.');
            }
        }

        $app = $this->getApplicationInstance();

        // assign the app to the app trait
        $instance->setAppInstance($app);

        // set the instance template
        $this->setTemplate($instance);

        // call the setUp method
        $instance->setUp();

        return $instance;
    }