void () { Project project = ProjectManagerEx.getInstanceEx().newProject(myProjectDir, new OpenProjectTaskBuilder().build()); try { createModule(project, "module", ModuleTypeId.JAVA_MODULE); PlatformTestUtil.saveProject(project); } finally { PlatformTestUtil.forceCloseProjectWithoutSaving(project); } project = ProjectManagerEx.getInstanceEx().newProject(myProjectDir, new OpenProjectTaskBuilder().build()); try { PlatformTestUtil.saveProject(project); assertThat(ModuleManager.getInstance(project).getModules()).isEmpty(); } finally { PlatformTestUtil.forceCloseProjectWithoutSaving(project); } }