docs: protected void customizeContext(PortletContext portletContext, ConfigurablePortletApplicationContext applicationContext) {
          List<Class<ApplicationContextInitializer<ConfigurableApplicationContext>>> initializerClasses =
                  determineContextInitializerClasses(portletContext);
  
          if (initializerClasses.size() == 0) {
              // no ApplicationContextInitializers have been declared -> nothing to do
              return;
          }
  
          ArrayList<ApplicationContextInitializer<ConfigurableApplicationContext>> initializerInstances =
              new ArrayList<ApplicationContextInitializer<ConfigurableApplicationContext>>();
  
          for (Class<ApplicationContextInitializer<ConfigurableApplicationContext>> initializerClass : initializerClasses) {
              Class<?> contextClass = applicationContext.getClass();
              Class<?> initializerContextClass =
                  GenericTypeResolver.resolveTypeArgument(initializerClass, ApplicationContextInitializer.class);
              Assert.isAssignable(initializerContextClass, contextClass, String.format(
                      "Could not add context initializer [%s] as its generic parameter [%s] " +
                      "is not assignable from the type of application context used by this " +
                      "context loader [%s]", initializerClass.getName(), initializerContextClass, contextClass));
              initializerInstances.add(BeanUtils.instantiateClass(initializerClass));
          }
  
          //TODO remove cast when ContribXmlPortletApplicationContext is merged into super classes
          ((ConfigurablePortletEnvironment)applicationContext.getEnvironment()).initPropertySources(this.servletContext, portletContext, null);
  
          Collections.sort(initializerInstances, new AnnotationAwareOrderComparator());
          for (ApplicationContextInitializer<ConfigurableApplicationContext> initializer : initializerInstances) {
              initializer.initialize(applicationContext);
          }
      }