List<ExternalSystemNode<ExternalConfigPathAware>> (@NotNull AnActionEvent e) { final List<ExternalSystemNode> selectedNodes = e.getData(ExternalSystemDataKeys.SELECTED_NODES); if (selectedNodes == null || selectedNodes.isEmpty()) return Collections.emptyList(); return selectedNodes.stream() .map(node -> (node instanceof ModuleNode || node instanceof ProjectNode) ? (ExternalSystemNode<ExternalConfigPathAware>)node : null) .filter(Objects::nonNull) .collect(Collectors.toList()); }