private static boolean areExpressionsConvertibleToMethodParameters(PsiType[] expressionTypes,
                                                                     PsiParameter[] parameters,
                                                                     int predicateExpressionPosition) {
    if (parameters.length == 0 || (parameters.length > expressionTypes.length && !parameters[expressionTypes.length].isVarArgs())) {
      return false;
    }

    boolean isJavaPredicatePresented = false;
    int parametersLastIndex = parameters.length - 1;
    for (int expressionTypeIndex = 0; expressionTypeIndex < expressionTypes.length; ++expressionTypeIndex) {
      PsiType parameterType;
      if (expressionTypeIndex < parameters.length) {
        if (parameters[expressionTypeIndex].isVarArgs()) {
          parameterType = ((PsiArrayType)parameters[expressionTypeIndex].getType()).getComponentType();
        }
        else {
          parameterType = parameters[expressionTypeIndex].getType();
        }
      }
      else {
        if (!parameters[parametersLastIndex].isVarArgs()) return false;
        parameterType = ((PsiArrayType)parameters[parametersLastIndex].getType()).getComponentType();
      }
      if (!parameterType.isConvertibleFrom(expressionTypes[expressionTypeIndex])) return false;
      PsiClass parameterClass = PsiTypesUtil.getPsiClass(parameterType);
      if (parameterClass == null) continue;
      String qualifiedClassName = parameterClass.getQualifiedName();
      if (qualifiedClassName == null) continue;

      if (expressionTypeIndex == predicateExpressionPosition && qualifiedClassName.equals(CommonClassNames.JAVA_UTIL_FUNCTION_PREDICATE)) {
        isJavaPredicatePresented = true;
      }
    }
    return isJavaPredicatePresented;
  }
private static boolean areExpressionsConvertibleToMethodParameters(PsiType[] expressionTypes,
                                                                     PsiParameter[] parameters,
                                                                     int predicateExpressionPosition)