return getPsiClass(psiParameter, wrapperClass, psiParameterType);
}
private static PsiClass getPsiClass(PsiElement psiElement, PsiClass wrapperClass,
PsiType psiFieldType) {
PsiClassType psiClassType = (PsiClassType) psiFieldType;
Project project = psiElement.getProject();
JavaPsiFacade javaPsiFacade = JavaPsiFacade.getInstance(project);
GlobalSearchScope globalSearchScope = GlobalSearchScope.allScope(project);
PsiClass lazyClass = javaPsiFacade.findClass(CLASS_LAZY, globalSearchScope);
PsiClass providerClass = javaPsiFacade.findClass(CLASS_PROVIDER, globalSearchScope);
PsiClassType.ClassResolveResult classResolveResult = psiClassType.resolveGenerics();
PsiClass outerClass = classResolveResult.getElement();
// If Lazy<Foo> or Provider<Foo>, extract Foo as the interesting type.
if (outerClass != null //
&& (outerClass.equals(lazyClass) || outerClass.equals(providerClass))) {