List<File> () { List<File> result = new ArrayList<>(); File[] gitRoots = getSortedSubReposRoots(new File(PathManager.getHomePath())); for (File subdir : gitRoots) { //noinspection IdentifierGrammar File pluginsDir = new File(subdir, "plugins"); if (pluginsDir.exists()) { result.add(pluginsDir); } else { result.add(subdir); } result.addAll(Arrays.asList(getSortedSubReposRoots(subdir))); } return result; }