void () { ModulePointerManager pointerManager = getPointerManager(); final ModulePointer pointer = pointerManager.create("xxx"); ModifiableModuleModel modifiableModel = getModuleManager().getModifiableModel(); Module module = modifiableModel.newModule(ProjectKt.getStateStore(myProject).getProjectBasePath().resolve("xxx.iml"), EmptyModuleType.getInstance().getId()); assertThat(pointerManager.create(module)).isSameAs(pointer); assertThat(pointerManager.create("xxx")).isSameAs(pointer); assertThat(pointer.getModule()).isSameAs(module); assertThat(pointer.getModuleName()).isEqualTo("xxx"); ApplicationManager.getApplication().runWriteAction(() -> modifiableModel.dispose()); assertThat(pointer.getModule()).isNull(); assertThat(pointer.getModuleName()).isEqualTo("xxx"); }