void () { ExtensionPoint<@NotNull String> extensionPoint = buildExtensionPoint(String.class); List<Integer> sizeList = new ArrayList<>(); extensionPoint.addExtensionPointListener(new ExtensionPointListener<String>() { @Override public void extensionRemoved(@NotNull String extension, @NotNull PluginDescriptor pluginDescriptor) { sizeList.add(extensionPoint.getExtensionList().size()); } }, true, null); //noinspection deprecation extensionPoint.registerExtension("first"); assertThat(extensionPoint.getExtensionList().size()).isEqualTo(1); extensionPoint.unregisterExtensions((adapterName, adapter) -> false, false); assertThat(sizeList).contains(0); }