void () { BeanExtensionPoint<KeyedLazyInstance<Integer>> extensionPoint = new BeanExtensionPoint<>("foo", KeyedLazyInstance.class.getName(), new DefaultPluginDescriptor("test"), new MyComponentManager(), true); KeyedLazyInstance<Integer> extension = new KeyedLazyInstance<Integer>() { @Override public String getKey() { return "one"; } @Override public @NotNull Integer getInstance() { return 1; } }; extensionPoint.registerExtension(extension); Disposable disposable = ExtensionPointUtil.createKeyedExtensionDisposable(extension.getInstance(), extensionPoint); extensionPoint.unregisterExtension(extension); assertThat(Disposer.isDisposed(disposable)).isTrue(); Disposer.dispose(extensionPoint.componentManager); }