void (@NotNull Path folder, boolean includeNestDirs, @NotNull Collection<? super String> result) { if (JdkUtil.checkForJdk(folder)) { result.add(folder.toAbsolutePath().toString()); return; } if (!includeNestDirs) return; try (Stream<Path> files = Files.list(folder)) { files.forEach(candidate -> { for (Path adjusted : listPossibleJdkHomesFromInstallRoot(candidate)) { scanFolder(adjusted, false, result); } }); } catch (IOException ignore) { } }