LongRangeSet (@NotNull PsiCallExpression call) { LongRangeSet counts = LongRangeSet.empty(); for (CandidateInfo candidate : PsiResolveHelper.getInstance(call.getProject()).getReferencedMethodCandidates(call, false)) { PsiMethod element = ObjectUtils.tryCast(candidate.getElement(), PsiMethod.class); if (element != null) { int count = element.getParameterList().getParametersCount(); counts = counts.join(element.isVarArgs() ? LongRangeSet.range(count - 1, Integer.MAX_VALUE) : LongRangeSet.point(count)); } } return counts; }