void (@NotNull JavaSdkVersion testVersion, @NotNull Module module, @NotNull Disposable parentDisposable) { Sdk sdk = ModuleRootManager.getInstance(module).getSdk(); Assert.assertNotNull(sdk); String oldVersionString = sdk.getVersionString(); // hack ((SdkModificator)sdk).setVersionString(testVersion.getDescription()); Assert.assertSame(testVersion, JavaSdk.getInstance().getVersion(sdk)); Disposer.register(parentDisposable, () -> ((SdkModificator)sdk).setVersionString(oldVersionString)); }