Collection<VirtualFile> () { Collection<AbstractTreeNode<?>> children = getChildren(); Set<VirtualFile> result = new HashSet<>(); for (AbstractTreeNode each : children) { if (each instanceof ProjectViewNode) { result.addAll(((ProjectViewNode<?>)each).getRoots()); } } return result; }