void () { ExtensionPoint<EntryPoint> point = EntryPointsManagerBase.DEAD_CODE_EP_NAME.getPoint(); EntryPoint extension = new EntryPoint() { @NotNull @Override public String getDisplayName() { return "duh"; } @Override public boolean isEntryPoint(@NotNull RefElement refElement, @NotNull PsiElement psiElement) { return false; } @Override public boolean isEntryPoint(@NotNull PsiElement psiElement) { return false; } @Override public boolean isSelected() { return false; } @Override public void setSelected(boolean selected) { } @Override public void readExternal(Element element) { } @Override public void writeExternal(Element element) { } @Override public String[] getIgnoreAnnotations() { return new String[]{"MyAnno"}; } }; enableInspectionTool(new UnusedDeclarationInspectionBase(true)); doTest(true, false); List<HighlightInfo> infos = doHighlighting(HighlightSeverity.WARNING); assertEquals(2, infos.size()); // unused class and unused method point.registerExtension(extension, getTestRootDisposable()); infos = doHighlighting(HighlightSeverity.WARNING); assertEmpty(infos); }