String (@NotNull PsiElement element) { if (element instanceof PsiEnumConstantInitializer initializer) { return initializer.getEnumConstant().getName(); } if (element instanceof PsiAnonymousClass) { return JavaBundle.message("tooltip.anonymous"); } if (element instanceof PsiNamedElement named) { return named.getName(); } return null; }