List<VirtualFile> (@NotNull Module mainModule) { if (!computeSuitableTestRootUrls(mainModule).isEmpty()) { //create test in the same module, if the test source folder doesn't exist yet it will be created return suitableTestSourceFolders(mainModule) .map(SourceFolder::getFile) .filter(Objects::nonNull) .collect(Collectors.toList()); } //suggest to choose from all dependencies modules final HashSet<Module> modules = new HashSet<>(); ModuleUtilCore.collectModulesDependsOn(mainModule, modules); return modules.stream() .flatMap(CreateTestUtils::suitableTestSourceFolders) .map(SourceFolder::getFile) .filter(Objects::nonNull) .collect(Collectors.toList()); }