PsiType (PsiType collectionType) { if (collectionType instanceof PsiClassType classType) { PsiType[] parameters = classType.getParameters(); if (parameters.length == 1) { return parameters[0]; } } return null; }