PsiClassType (Project project, String collectionName, PsiType... item) { PsiElementFactory factory = JavaPsiFacade.getElementFactory(project); PsiClass collection = JavaPsiFacade.getInstance(project).findClass(collectionName, GlobalSearchScope.allScope(project)); if (collection == null) return null; PsiTypeParameter[] parameters = collection.getTypeParameters(); if (parameters.length != 1) return null; return factory.createType(collection, item); }