docs: static DeploymentInfo adaptDeploymentInfo(DeploymentInfo src, URI uri, ServletInfo servletInfo) {
          final String contextPath = uri.getPath();
          final String deploymentName = src.getDeploymentName() + ":" + uri.getPath();
  
          final DeploymentInfo info = new DeploymentInfo()
                  .setClassLoader(src.getClassLoader())
                  .setContextPath(contextPath)
                  .setResourceManager(src.getResourceManager())
                  .setMajorVersion(src.getMajorVersion())
                  .setMinorVersion(src.getMinorVersion())
                  .setDeploymentName(deploymentName)
                  .setClassIntrospecter(src.getClassIntrospecter());
  
          info.addServlet(servletInfo);
  
          for (Map.Entry<String, FilterInfo> e : src.getFilters().entrySet()) {
              info.addFilter(e.getValue().clone());
          }
          info.setDisplayName(src.getDisplayName());
          for (FilterMappingInfo fmi : src.getFilterMappings()) {
              switch (fmi.getMappingType()) {
              case URL:
                  info.addFilterUrlMapping(fmi.getFilterName(), fmi.getMapping(), fmi.getDispatcher());
                  break;
              case SERVLET:
                  info.addFilterServletNameMapping(fmi.getFilterName(), fmi.getMapping(), fmi.getDispatcher());
                  break;
              default:
                  throw new IllegalStateException(
                          "Unexpected " + io.undertow.servlet.api.FilterMappingInfo.MappingType.class.getName() + " "
                                  + fmi.getMappingType());
              }
          }
          final List<ListenerInfo> listeners = src.getListeners();
          final List<String> approvedListeners = Arrays.asList(
                  "org.wildfly.extension.undertow.deployment.JspInitializationListener",
                  "org.jboss.weld.module.web.servlet.WeldInitialListener",
                  "org.jboss.weld.module.web.servlet.WeldTerminalListener",
                  "org.wildfly.microprofile.opentracing.smallrye.TracerInitializer"
                  );
          final String infoServiceListenerClassNamePrefix = UndertowDeploymentInfoService.class.getName() + "$";
          for (ListenerInfo listenerInfo : listeners) {
              CamelLogger.LOGGER.debug("Copying ListenerInfo {}", listenerInfo);
              if (listenerInfo.getListenerClass().getName().startsWith(infoServiceListenerClassNamePrefix)) {
                  /* ignore */
              } else {
                  assert approvedListeners.stream().anyMatch(cl -> cl.equals(listenerInfo.getListenerClass().getName())) : "Unexpected "+ ListenerInfo.class.getName() + ": "+ listenerInfo + "; expected any of ["+ approvedListeners.stream().collect(Collectors.joining(", ")) +"]";
                  info.addListener(listenerInfo);
              }
          }
  
          info.addServletContainerInitalizers(src.getServletContainerInitializers());
          for (ThreadSetupHandler a : src.getThreadSetupActions()) {
              info.addThreadSetupAction(a);
          }
          for (Entry<String, String> en : src.getInitParameters().entrySet()) {
              info.addInitParameter(en.getKey(), en.getValue());
          }
          for (Entry<String, Object> en : src.getServletContextAttributes().entrySet()) {
              if (WebSocketDeploymentInfo.ATTRIBUTE_NAME.equals(en.getKey())) {
                  final WebSocketDeploymentInfo srcWsdi = (WebSocketDeploymentInfo) en.getValue();
  
                  /* Simplify start
                   * Once https://github.com/undertow-io/undertow/pull/672 reaches us
                   * the follwing code can be simplified using the newly added WebSocketDeploymentInfo methods clone()
                   * and [get|add]Listeners() */
                  final WebSocketDeploymentInfo targetWsdi = new WebSocketDeploymentInfo()
                          .setWorker(srcWsdi.getWorker())
                          .setBuffers(srcWsdi.getBuffers())
                          .setDispatchToWorkerThread(srcWsdi.isDispatchToWorkerThread())
                          .setReconnectHandler(srcWsdi.getReconnectHandler())
                          ;
                  targetWsdi.setClientBindAddress(srcWsdi.getClientBindAddress());
                  srcWsdi.getAnnotatedEndpoints().stream().forEach(e -> targetWsdi.addEndpoint(e));
                  srcWsdi.getProgramaticEndpoints().stream().forEach(e -> targetWsdi.addEndpoint(e));
                  srcWsdi.getExtensions().stream().forEach(e -> targetWsdi.addExtension(e));
                  try {
                      final Field containerReadyListenersField = srcWsdi.getClass().getDeclaredField("containerReadyListeners");
                      containerReadyListenersField.setAccessible(true);
                      @SuppressWarnings("unchecked")
                      final List<ContainerReadyListener> containerReadyListeners = (List<ContainerReadyListener>) containerReadyListenersField.get(srcWsdi);
                      assert containerReadyListeners.stream().anyMatch(l -> l.getClass().getName().startsWith(infoServiceListenerClassNamePrefix)) : infoServiceListenerClassNamePrefix + "* not found in "+ WebSocketDeploymentInfo.class.getSimpleName() + ".containerReadyListeners";
                      assert containerReadyListeners.size() == 1 : WebSocketDeploymentInfo.class.getSimpleName() + ".containerReadyListeners.size() expected 1, actual "+ listeners.size();
                  } catch (NoSuchFieldException | SecurityException | IllegalAccessException e1) {
                      throw new RuntimeException(e1);
                  }
                  /* Simplify end */
              } else {
                  info.addServletContextAttribute(en.getKey(), en.getValue());
              }
          }
          info.addWelcomePages(src.getWelcomePages());
          info.addErrorPages(src.getErrorPages());
          info.addMimeMappings(src.getMimeMappings());
          info.setExecutor(src.getExecutor());
          info.setAsyncExecutor(src.getAsyncExecutor());
          info.setTempDir(src.getTempDir());
          info.setJspConfigDescriptor(src.getJspConfigDescriptor());
          info.setDefaultServletConfig(src.getDefaultServletConfig());
          for (Entry<String, String> en : src.getLocaleCharsetMapping().entrySet()) {
              info.addLocaleCharsetMapping(en.getKey(), en.getValue());
          }
          info.setSessionManagerFactory(src.getSessionManagerFactory());
          final LoginConfig loginConfig = src.getLoginConfig();
          if (loginConfig != null) {
              info.setLoginConfig(loginConfig.clone());
          }
          info.setIdentityManager(src.getIdentityManager());
          info.setConfidentialPortManager(src.getConfidentialPortManager());
          info.setDefaultEncoding(src.getDefaultEncoding());
          info.setUrlEncoding(src.getUrlEncoding());
          info.addSecurityConstraints(filterConstraints(src, uri));
          for (HandlerWrapper w : src.getOuterHandlerChainWrappers()) {
              info.addOuterHandlerChainWrapper(w);
          }
          for (HandlerWrapper w : src.getInnerHandlerChainWrappers()) {
              info.addInnerHandlerChainWrapper(w);
          }
          info.setInitialSecurityWrapper(src.getInitialSecurityWrapper());
          for (HandlerWrapper w : src.getSecurityWrappers()) {
              info.addSecurityWrapper(w);
          }
          for (HandlerWrapper w : src.getInitialHandlerChainWrappers()) {
              info.addInitialHandlerChainWrapper(w);
          }
          info.addSecurityRoles(src.getSecurityRoles());
          info.addNotificationReceivers(src.getNotificationReceivers());
          info.setAllowNonStandardWrappers(src.isAllowNonStandardWrappers());
          info.setDefaultSessionTimeout(src.getDefaultSessionTimeout());
          info.setServletContextAttributeBackingMap(src.getServletContextAttributeBackingMap());
          info.setServletSessionConfig(src.getServletSessionConfig());
          info.setHostName(src.getHostName());
          info.setDenyUncoveredHttpMethods(src.isDenyUncoveredHttpMethods());
          info.setServletStackTraces(src.getServletStackTraces());
          info.setInvalidateSessionOnLogout(src.isInvalidateSessionOnLogout());
          info.setDefaultCookieVersion(src.getDefaultCookieVersion());
          info.setSessionPersistenceManager(src.getSessionPersistenceManager());
          for (Map.Entry<String, Set<String>> e : src.getPrincipalVersusRolesMap().entrySet()) {
              info.addPrincipalVsRoleMappings(e.getKey(), e.getValue());
          }
          info.setIgnoreFlush(src.isIgnoreFlush());
          info.setAuthorizationManager(src.getAuthorizationManager());
          for (Entry<String, AuthenticationMechanismFactory> e : src.getAuthenticationMechanisms().entrySet()) {
              info.addAuthenticationMechanism(e.getKey(), e.getValue());
          }
          info.setJaspiAuthenticationMechanism(src.getJaspiAuthenticationMechanism());
          info.setSecurityContextFactory(src.getSecurityContextFactory());
          info.setServerName(src.getServerName());
          info.setMetricsCollector(src.getMetricsCollector());
          info.setSessionConfigWrapper(src.getSessionConfigWrapper());
          info.setEagerFilterInit(src.isEagerFilterInit());
          info.setDisableCachingForSecuredPages(src.isDisableCachingForSecuredPages());
          info.setExceptionHandler(src.getExceptionHandler());
          info.setEscapeErrorMessage(src.isEscapeErrorMessage());
          for (SessionListener e : src.getSessionListeners()) {
              info.addSessionListener(e);
          }
          for (LifecycleInterceptor e : src.getLifecycleInterceptors()) {
              info.addLifecycleInterceptor(e);
          }
          info.setAuthenticationMode(src.getAuthenticationMode());
          info.setDefaultMultipartConfig(src.getDefaultMultipartConfig());
          info.setContentTypeCacheSize(src.getContentTypeCacheSize());
          info.setSessionIdGenerator(src.getSessionIdGenerator());
          info.setSendCustomReasonPhraseOnError(src.isSendCustomReasonPhraseOnError());
          info.setChangeSessionIdOnLogin(src.isChangeSessionIdOnLogin());
          info.setCrawlerSessionManagerConfig(src.getCrawlerSessionManagerConfig());
          info.setSecurityDisabled(src.isSecurityDisabled());
          info.setUseCachedAuthenticationMechanism(src.isUseCachedAuthenticationMechanism());
          info.setCheckOtherSessionManagers(src.isCheckOtherSessionManagers());
  
          return info;
      }