PsiType (@NotNull final PsiClass interface2Consider, @NotNull final PsiFunctionalExpression expression, @NotNull final PsiType[] left, @NotNull final PsiType[] right) { final Project project = interface2Consider.getProject(); final PsiSubstitutor substitutor = PsiResolveHelper.getInstance(project) .inferTypeArguments(interface2Consider.getTypeParameters(), left, right, PsiUtil.getLanguageLevel(expression)); final PsiType type = JavaPsiFacade.getElementFactory(project).createType(interface2Consider, substitutor); return expression.isAcceptable(type) ? type : null; }