private static boolean checkMethodSignature(@NotNull PsiMethodCallExpression invokeCall,
                                              @NotNull PsiExpression signatureExpression,
                                              boolean isExact,
                                              boolean isConstructor,
                                              int argumentOffset,
                                              @NotNull ProblemsHolder holder) {
    final List<Supplier<ReflectiveType>> lazyMethodSignature = getLazyMethodSignature(signatureExpression);
    if (lazyMethodSignature == null) return true;

    if (!isConstructor && lazyMethodSignature.size() != 0) {
      final ReflectiveType returnType = lazyMethodSignature.get(0).get();
      checkReturnType(invokeCall, returnType, isExact, holder);
    }

    final PsiExpressionList argumentList = invokeCall.getArgumentList();
    final PsiExpression[] arguments = argumentList.getExpressions();
    final JavaReflectionInvocationInspection.Arguments actualArguments =
      JavaReflectionInvocationInspection.getActualMethodArguments(arguments, argumentOffset, true);
    if (actualArguments == null) return true;

    final int requiredArgumentCount = lazyMethodSignature.size() - 1; // -1 excludes the return type
    final boolean maybeVararg;
    if (!isExact && requiredArgumentCount > 0) {
      ReflectiveType type = lazyMethodSignature.get(requiredArgumentCount).get();
      maybeVararg = type != null && type.getType() instanceof PsiArrayType;
    } else {
      maybeVararg = false;
    }
    PsiExpression[] expressions = actualArguments.expressions();
    if (!maybeVararg || expressions.length < requiredArgumentCount - 1) {
      if (!checkArgumentCount(expressions, requiredArgumentCount, argumentOffset, argumentList, holder)) return false;
    }

    for (int i = 0; i < expressions.length; i++) {
      int parameterIndex = maybeVararg && i >= requiredArgumentCount - 1 ? requiredArgumentCount : i + 1;
      final ReflectiveType requiredType = lazyMethodSignature.get(parameterIndex).get();
      checkArgumentType(expressions[i], requiredType, argumentList, isExact, maybeVararg && i >= requiredArgumentCount - 1, holder);
    }
    return true;
  }
private static boolean checkMethodSignature(@NotNull PsiMethodCallExpression invokeCall,
                                              @NotNull PsiExpression signatureExpression,
                                              boolean isExact,
                                              boolean isConstructor,
                                              int argumentOffset,
                                              @NotNull ProblemsHolder holder)