Set<PsiTypeParameter> (@NotNull PsiType type) { if (type instanceof PsiClassType) { PsiTypesUtil.TypeParameterSearcher searcher = new PsiTypesUtil.TypeParameterSearcher(); type.accept(searcher); return searcher.getTypeParameters(); } return Collections.emptySet(); }