void () { VirtualFile dir = createSrc(); String url = dir.getUrl(); Ref<ContentEntry> ref = Ref.create(); ModuleRootModificationUtil.updateModel(myModule, model -> { var entry = model.addContentEntry(url + "/"); ref.set(entry); }); ContentFolder f = ref.get().addExcludeFolder(url); assertEquals(dir, f.getFile()); assertEquals(url, f.getUrl()); }