void () { Ref<DirectorySpec> firstDirSpec = new Ref<>(); Ref<DirectorySpec> secondDirSpec = new Ref<>(); ProjectStructureDslKt.createJavaModule(projectModelRule, "module", moduleContentBuilder -> { moduleContentBuilder.source("sourceRoot", JavaSourceRootType.SOURCE, contentBuilder -> { firstDirSpec.set(contentBuilder.dir("first", builder1 -> Unit.INSTANCE)); secondDirSpec.set(contentBuilder.dir("second", builder1 -> Unit.INSTANCE)); return Unit.INSTANCE; }); return Unit.INSTANCE; }); VirtualFile firstDir = ProjectStructureDslKt.resolveVirtualFile(firstDirSpec.get()); VirtualFile secondDir = ProjectStructureDslKt.resolveVirtualFile(secondDirSpec.get()); assertNothingToRescan(); updateExcludedRoots(urls -> { urls.add(firstDir.getUrl()); urls.add(secondDir.getUrl()); }); assertNothingToRescanAndFinishIndexing(); updateExcludedRoots(urls -> urls.clear()); assertRescanningProjectContent(UNSURE, firstDir, secondDir); updateExcludedRoots(urls -> { urls.add(secondDir.getUrl()); }); assertRescanningProjectContent(YES, firstDir); updateExcludedRoots(urls -> urls.clear()); assertRescanningProjectContent(YES, secondDir); }