List<PsiDirectory> () { List<PsiDirectory> dirs = new ArrayList<>(); if (myDirectory != null) { dirs.add(myDirectory); } else if (myModule != null) { List<PsiDirectory> allModuleDirs = FileRecursiveIterator.collectModuleDirectories(myModule); dirs.addAll(allModuleDirs); } else { List<PsiDirectory> allProjectDirs = FileRecursiveIterator.collectProjectDirectories(myProject); dirs.addAll(allProjectDirs); } return dirs; }