boolean (Object element, PsiElement context) { switch (myKind) { case CLASS: return element instanceof PsiClass; case ENUM_CONST: return element instanceof PsiEnumConstant; case FIELD: return element instanceof PsiField; case METHOD: return element instanceof PsiMethod; case PACKAGE: return element instanceof PsiPackage; case VARIABLE: return element instanceof PsiVariable; } return false; }