private static PsiExpression @Nullable [] getVarargArguments(PsiExpression @NotNull [] arguments,
                                                                 @NotNull PsiElement originElement,
                                                                 PsiParameter @NotNull [] parameters) {
      PsiParameter last = ArrayUtil.getLastElement(parameters);
      if (last == null) return null;
      if (!last.isVarArgs()) return null;
      PsiExpression closestExpression = getTopmostExpression(getClosestExpression(originElement));
      if (closestExpression == null) return null;
      int indexOfCurrent = Arrays.asList(arguments).indexOf(closestExpression);
      if (-1 == indexOfCurrent) return null;
      if (indexOfCurrent < parameters.length - 1) return null;
      if (arguments.length < parameters.length + MIN_ELEMENTS_COUNT - 1) return null;
      return Arrays.copyOfRange(arguments, parameters.length - 1, arguments.length);
    }
private static PsiExpression @Nullable [] getVarargArguments(PsiExpression @NotNull [] arguments,
                                                                 @NotNull PsiElement originElement,
                                                                 PsiParameter @NotNull [] parameters)