private static @Nullable PsiType getAcceptableType(final @NotNull PsiClass interface2Consider,
                                           final @NotNull PsiFunctionalExpression expression,
                                           final @NotNull PsiType[] left,
                                           final @NotNull 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;
  }
private static @Nullable PsiType getAcceptableType(final @NotNull PsiClass interface2Consider,
                                           final @NotNull PsiFunctionalExpression expression,
                                           final @NotNull PsiType[] left,
                                           final @NotNull PsiType[] right)