private static boolean areConvertibleTypesWithVarArgs(@NotNull PsiParameterList parameterListWithVarArgs,
                                                          @NotNull PsiParameterList otherParameterList) {
      PsiParameter[] parametersWithVarArgs = parameterListWithVarArgs.getParameters();
      PsiParameter[] otherParameters = otherParameterList.getParameters();

      int lengthForVarArgs = parametersWithVarArgs.length;
      int otherLength = otherParameters.length;

      //example:
      //parameterListWithVarArgs: (Integer i1, Integer i2, String... strings)
      //otherParameterList: (Integer i1)
      if (lengthForVarArgs > otherLength + 1) {
        return false;
      }

      for (int i = 0; i < otherLength; i++) {
        PsiType type = i < lengthForVarArgs ? getTypeForComparison(parametersWithVarArgs[i]) :
                       getTypeForComparison(parametersWithVarArgs[lengthForVarArgs - 1]);

        PsiType otherType = getTypeForComparison(otherParameters[i]);

        if (!type.isConvertibleFrom(otherType) && !otherType.isConvertibleFrom(type)) {
          return false;
        }
      }

      return true;
    }
private static boolean areConvertibleTypesWithVarArgs(@NotNull PsiParameterList parameterListWithVarArgs,
                                                          @NotNull PsiParameterList otherParameterList)