Source:
public App createApp(AppReference appReference, String contextPath) { DependencyNode rootNode = YamlFileParser.parse(appReference.getDependencyTree(), DependencyNode.class); final String appName = rootNode.getArtifactId(); final String appContextPath = (contextPath == null) ? rootNode.getContextPath() : contextPath; final Configuration configuration = createConfiguration(appReference); final Bindings bindings = new Bindings(); final I18nResources i18nResources = new I18nResources(); final Map<String, Component> createdComponents = new HashMap<>(); rootNode.traverse(dependencyNode -> { if (createdComponents.containsKey(dependencyNode.getArtifactId())) { return; } Component component = createComponent(dependencyNode, appReference, rootNode, appContextPath, createdComponents, bindings, i18nResources); createdComponents.put(component.getName(), component); }); final Set<Theme> themes = appReference.getThemeReferences().map(this::createTheme).collect(toSet()); SessionManagerFactory sessionManagerFactory = configuration.getSessionManagerFactoryClassName() .map(sessionManagerFactoryClass -> pluginProvider .getPluginInstance(SessionManagerFactory.class, sessionManagerFactoryClass, this.getClass().getClassLoader())) .orElse(pluginProvider.getPluginInstance(SessionManagerFactory.class, InMemorySessionManagerFactory.class.getName(), this.getClass().getClassLoader())); SessionManager sessionManager = sessionManagerFactory.getSessionManager(appName, configuration); Authorizer authorizer = configuration.getAuthorizer() .map(authorizerClass -> pluginProvider.getPluginInstance(Authorizer.class, authorizerClass, this.getClass().getClassLoader())) .orElse(null); return new App(appName, appContextPath, new HashSet<>(createdComponents.values()), themes, configuration, bindings, i18nResources, sessionManager, authorizer); }

Target:
public App createApp(AppReference appReference, String contextPath) { DependencyNode rootNode = YamlFileParser.parse(appReference.getDependencyTree(), DependencyNode.class); final String appName = rootNode.getArtifactId(); final String appContextPath = (contextPath == null) ? rootNode.getContextPath() : contextPath; final Configuration configuration = createConfiguration(appReference); final Bindings bindings = new Bindings(); final I18nResources i18nResources = new I18nResources(); final Map<String, Component> createdComponents = new HashMap<>(); rootNode.traverse(dependencyNode -> { if (createdComponents.containsKey(dependencyNode.getArtifactId())) { return; } Component component = createComponent(dependencyNode, appReference, rootNode, appContextPath, createdComponents, bindings, i18nResources); createdComponents.put(component.getName(), component); }); final Set<Theme> themes = appReference.getThemeReferences().map(this::createTheme).collect(toSet()); SessionManagerFactory sessionManagerFactory = configuration.getSessionManagerFactoryClassName() .map(sessionManagerFactoryClass -> pluginProvider .getPluginInstance(SessionManagerFactory.class, sessionManagerFactoryClass, this.getClass().getClassLoader())) .orElse(pluginProvider.getPluginInstance(SessionManagerFactory.class, InMemorySessionManagerFactory.class.getName(), this.getClass().getClassLoader())); SessionManager sessionManager = sessionManagerFactory.getSessionManager(appName, configuration); Authorizer authorizer = configuration.getAuthorizer() .map(authorizerClass -> pluginProvider.getPluginInstance(Authorizer.class, authorizerClass, this.getClass().getClassLoader())) .orElse(null); if (authorizer == null) { LOGGER.warn("No authorizer is configured for '{}' app.", appName); } return new App(appName, appContextPath, new HashSet<>(createdComponents.values()), themes, configuration, bindings, i18nResources, sessionManager, authorizer); }