Set<SuppressableInspectionTreeNode> (AnActionEvent e) { Object[] selectedNodes = e.getData(PlatformCoreDataKeys.SELECTED_ITEMS); if (selectedNodes == null) return Collections.emptySet(); final Set<SuppressableInspectionTreeNode> result = new HashSet<>(); for (Object selectedNode : selectedNodes) { if (!TreeUtil.treeNodeTraverser((TreeNode)selectedNode).traverse().processEach(node1 -> { //fetch leaves final InspectionTreeNode n = (InspectionTreeNode)node1; if (n instanceof SuppressableInspectionTreeNode && ((SuppressableInspectionTreeNode)n).canSuppress() && n.isValid()) { if (((SuppressableInspectionTreeNode)n).getAvailableSuppressActions().contains(mySuppressAction)) { result.add((SuppressableInspectionTreeNode)n); } else { return false; } } return true; })) { return Collections.emptySet(); } } return result; }