PsiClassType (Project project, PsiVariable variable) { final JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(project); final PsiClass consumerClass = psiFacade.findClass(CommonClassNames.JAVA_UTIL_FUNCTION_CONSUMER, variable.getResolveScope()); return consumerClass != null ? psiFacade.getElementFactory().createType(consumerClass, variable.getType()) : null; }