List<TaskActivationEntry> () { List<TaskActivationEntry> tasks = new SmartList<>(); for (DefaultMutableTreeNode node : myTree.getSelectedNodes(DefaultMutableTreeNode.class, null)) { tasks.addAll(findTasksUnder(ContainerUtil.ar((MyNode)node.getUserObject()))); } return tasks; }