void (Module module) { ModifiableModuleModel model = myModuleManager.getModifiableModel(); try { model.renameModule(module, RENAMED_MODULE_NAME); } catch (ModuleWithNameAlreadyExists e) { throw new IllegalStateException(e); } ApplicationManager.getApplication().runWriteAction(() -> model.commit()); module.getModuleFile(); TestCase.assertEquals(RENAMED_MODULE_NAME, module.getName()); }