docs: protected @Nullable <T> T doCreateBean(@Nullable BeanResolutionContext resolutionContext,
                                   @Nonnull BeanDefinition<T> beanDefinition,
                                   @Nullable Qualifier<T> qualifier,
                                   boolean isSingleton,
                                   @Nullable Map<String, Object> argumentValues) {
          Qualifier declaredQualifier = resolveDeclaredQualifier(beanDefinition);
          T bean;
          Class<T> beanType = beanDefinition.getBeanType();
          if (isSingleton) {
              BeanRegistration<T> beanRegistration = singletonObjects.get(new BeanKey(beanDefinition, declaredQualifier));
              if (beanRegistration != null) {
                  if (qualifier == null) {
                      return beanRegistration.bean;
                  } else if (qualifier.reduce(beanType, Stream.of(beanRegistration.beanDefinition)).findFirst().isPresent()) {
                      return beanRegistration.bean;
                  }
              } else if (qualifier != null) {
                  beanRegistration = singletonObjects.get(new BeanKey(beanDefinition, null));
                  if (beanRegistration != null) {
                      if (qualifier.reduce(beanType, Stream.of(beanRegistration.beanDefinition)).findFirst().isPresent()) {
                          return beanRegistration.bean;
                      }
                  }
              }
          }
  
          if (resolutionContext == null) {
              resolutionContext = new DefaultBeanResolutionContext(this, beanDefinition);
          }
  
          if (beanDefinition instanceof BeanFactory) {
              BeanFactory<T> beanFactory = (BeanFactory<T>) beanDefinition;
              try {
                  if (beanFactory instanceof ParametrizedBeanFactory) {
                      ParametrizedBeanFactory<T> parametrizedBeanFactory = (ParametrizedBeanFactory<T>) beanFactory;
                      Argument<?>[] requiredArguments = parametrizedBeanFactory.getRequiredArguments();
                      if (argumentValues == null) {
                          throw new BeanInstantiationException(resolutionContext, "Missing bean arguments for type: " + beanType.getName() + ". Requires arguments: " + ArrayUtils.toString(requiredArguments));
                      }
                      Map<String, Object> convertedValues = new LinkedHashMap<>(argumentValues);
                      for (Argument<?> requiredArgument : requiredArguments) {
                          Object val = argumentValues.get(requiredArgument.getName());
                          if (val == null && !requiredArgument.getAnnotationMetadata().hasDeclaredAnnotation(Nullable.class)) {
                              throw new BeanInstantiationException(resolutionContext, "Missing bean argument [" + requiredArgument + "].");
                          }
                          BeanResolutionContext finalResolutionContext = resolutionContext;
                          Object convertedValue = null;
                          if (val != null) {
                              convertedValue = ConversionService.SHARED.convert(val, requiredArgument).orElseThrow(() ->
                                      new BeanInstantiationException(finalResolutionContext, "Invalid bean argument [" + requiredArgument + "]. Cannot convert object [" + val + "] to required type: " + requiredArgument.getType())
                              );
                          }
                          convertedValues.put(requiredArgument.getName(), convertedValue);
                      }
  
                      bean = parametrizedBeanFactory.build(
                              resolutionContext,
                              this,
                              beanDefinition,
                              convertedValues
                      );
                  } else {
                      bean = beanFactory.build(resolutionContext, this, beanDefinition);
  
                      if (bean == null) {
                          if (!(beanDefinition.isIterable() || beanDefinition.getAnnotationMetadata().hasAnnotation(Factory.class))) {
                              throw new BeanInstantiationException(resolutionContext, "Bean Factory [" + beanFactory + "] returned null");
                          }
                      } else {
                          if (bean instanceof Qualified) {
                              ((Qualified) bean).$withBeanQualifier(declaredQualifier);
                          }
                      }
                  }
              } catch (Throwable e) {
                  if (e instanceof DependencyInjectionException) {
                      throw e;
                  }
                  if (e instanceof BeanInstantiationException) {
                      throw e;
                  } else {
                      if (!resolutionContext.getPath().isEmpty()) {
                          throw new BeanInstantiationException(resolutionContext, e);
                      } else {
                          throw new BeanInstantiationException(beanDefinition, e);
                      }
                  }
              }
          } else {
              ConstructorInjectionPoint<T> constructor = beanDefinition.getConstructor();
              Argument[] requiredConstructorArguments = constructor.getArguments();
              if (requiredConstructorArguments.length == 0) {
                  bean = constructor.invoke();
              } else {
                  Object[] constructorArgs = new Object[requiredConstructorArguments.length];
                  for (int i = 0; i < requiredConstructorArguments.length; i++) {
                      Class argument = requiredConstructorArguments[i].getType();
                      constructorArgs[i] = getBean(resolutionContext, argument);
                  }
                  bean = constructor.invoke(constructorArgs);
              }
  
              inject(resolutionContext, null, bean);
          }
  
          if (bean != null) {
              if (!BeanCreatedEventListener.class.isInstance(bean)) {
                  if (CollectionUtils.isNotEmpty(beanCreationEventListeners)) {
                      BeanKey beanKey = new BeanKey(beanDefinition, qualifier);
                      for (BeanRegistration<BeanCreatedEventListener> registration : beanCreationEventListeners) {
                          BeanDefinition<BeanCreatedEventListener> definition = registration.getBeanDefinition();
                          List<Argument<?>> typeArguments = definition.getTypeArguments(BeanCreatedEventListener.class);
                          if (CollectionUtils.isEmpty(typeArguments) || typeArguments.get(0).getType().isAssignableFrom(beanType)) {
                              BeanCreatedEventListener listener = registration.getBean();
                              bean = (T) listener.onCreated(new BeanCreatedEvent(this, beanDefinition, beanKey, bean));
                              if (bean == null) {
                                  throw new BeanInstantiationException(resolutionContext, "Listener [" + listener + "] returned null from onCreated event");
                              }
                          }
                      }
                  }
              }
              if (beanDefinition instanceof ValidatedBeanDefinition) {
                  bean = ((ValidatedBeanDefinition<T>) beanDefinition).validate(resolutionContext, bean);
              }
              if (LOG_LIFECYCLE.isDebugEnabled()) {
                  LOG_LIFECYCLE.debug("Created bean [{}] from definition [{}] with qualifier [{}]", bean, beanDefinition, qualifier);
              }
          }
  
          return bean;
      }