MyNode[] (final ExternalProjectSettings projectSettings, final ExternalProjectsStateProvider stateProvider, final RootNode parent) { List<String> paths = new ArrayList<>(stateProvider.getProjectsTasksActivationMap(myProjectSystemId).keySet()); paths.retainAll(projectSettings.getModules()); return ContainerUtil.mapNotNull(ArrayUtilRt.toStringArray(paths), path -> { final MyNode node = new ProjectNode(parent, stateProvider, projectSettings.getExternalProjectPath(), path); return node.getChildren().length > 0 ? node : null; }, new MyNode[]{}); }