List<FragmentNode> () { TreePath[] selectionPaths = myTree.getSelectionPaths(); if (ArrayUtil.isEmpty(selectionPaths)) { return Collections.emptyList(); } List<FragmentNode> result = new ArrayList<>(); for (TreePath path : selectionPaths) { result.addAll(getFragmentNodes(path)); } return result; }