void () { ServiceContainerUtil.registerExtension(ApplicationManager.getApplication(), EntryPointsManagerBase.DEAD_CODE_EP_NAME, new EntryPointWithVisibilityLevel() { @Override public void readExternal(Element element) throws InvalidDataException {} @Override public void writeExternal(Element element) throws WriteExternalException {} @NotNull @Override public String getDisplayName() { return "accepted visibility"; } @Override public boolean isEntryPoint(@NotNull RefElement refElement, @NotNull PsiElement psiElement) { return isEntryPoint(psiElement); } @Override public boolean isEntryPoint(@NotNull PsiElement psiElement) { return psiElement instanceof PsiMethod && "foo".equals(((PsiMethod)psiElement).getName()) || psiElement instanceof PsiClass; } @Override public int getMinVisibilityLevel(PsiMember member) { return member instanceof PsiMethod && isEntryPoint(member) ? PsiUtil.ACCESS_LEVEL_PACKAGE_LOCAL : ACCESS_LEVEL_INVALID; } @Override public boolean isSelected() { return true; } @Override public void setSelected(boolean selected) {} @Override public String getTitle() { return getDisplayName(); } @Override public String getId() { return getDisplayName(); } }, getTestRootDisposable()); myTool.SUGGEST_PACKAGE_LOCAL_FOR_MEMBERS = false; myTool.SUGGEST_PACKAGE_LOCAL_FOR_TOP_CLASSES = false; myTool.SUGGEST_PRIVATE_FOR_INNERS = true; doTest(getTestName(true), myTool, false, true); }