boolean (String fqName, PsiElement context) { final String shortName = ClassUtil.extractClassName(fqName); PsiElement parent = context.getParent(); while (parent != null && !(parent instanceof PsiFile)) { if (parent instanceof PsiTypeParameterListOwner) { for (PsiTypeParameter parameter : ((PsiTypeParameterListOwner)parent).getTypeParameters()) { if (shortName.equals(parameter.getName())) { return true; } } } parent = parent.getParent(); } return false; }