PsiType (PsiMethod method) { final PsiElement navigationElement = method.getNavigationElement(); if (navigationElement instanceof PsiMethod) { final PsiParameter[] parameters = ((PsiMethod)navigationElement).getParameterList().getParameters(); if (parameters.length != 0) { return TypeConversionUtil.erasure(parameters[0].getType()); } } final PsiClass containingClass = method.getContainingClass(); if (containingClass == null) return null; return JavaPsiFacade.getElementFactory(method.getProject()).createType(containingClass); }