boolean (Project project, AnActionEvent e, List<Object> items, List<Object> valueSubPath, Set<? super RunDashboardRunConfigurationNode> result) { for (Object item : items) { if (item instanceof RunDashboardServiceViewContributor || item instanceof GroupingNode) { List<Object> itemSubPath = new ArrayList<>(valueSubPath); itemSubPath.add(item); List<Object> children = ((ServiceViewManagerImpl)ServiceViewManager.getInstance(project)) .getChildrenSafe(e, itemSubPath, RunDashboardServiceViewContributor.class); if (!getLeaves(project, e, children, itemSubPath, result)) { return false; } } else if (item instanceof RunDashboardRunConfigurationNode) { result.add((RunDashboardRunConfigurationNode)item); } else if (item instanceof AbstractTreeNode) { AbstractTreeNode<?> parent = ((AbstractTreeNode<?>)item).getParent(); if (parent instanceof RunDashboardRunConfigurationNode) { result.add((RunDashboardRunConfigurationNode)parent); } else { return false; } } else { return false; } } return true; }