void () { ExtensionPoint<@NotNull Integer> extensionPoint = buildExtensionPoint(Integer.class); final boolean[] added = new boolean[1]; final boolean[] removed = new boolean[1]; extensionPoint.addExtensionPointListener(new ExtensionPointListener<Integer>() { @Override public void extensionAdded(@NotNull Integer extension, final @NotNull PluginDescriptor pluginDescriptor) { added[0] = true; } @Override public void extensionRemoved(@NotNull Integer extension, final @NotNull PluginDescriptor pluginDescriptor) { removed[0] = true; } }, true, null); assertThat(added[0]).isFalse(); assertThat(removed[0]).isFalse(); extensionPoint.registerExtension(123, disposable); assertThat(added[0]).isTrue(); assertThat(removed[0]).isFalse(); added[0] = false; Disposer.dispose(disposable); disposable = null; assertThat(added[0]).isFalse(); assertThat(removed[0]).isTrue(); }