void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { if (!(element instanceof PsiMethod method)) { return; } final Collection<PsiReferenceExpression> methodCalls = new ArrayList<>(); for (final PsiReference reference : ReferencesSearch.search(method, method.getUseScope(), false)) { final PsiElement referenceElement = reference.getElement(); if (referenceElement instanceof PsiReferenceExpression ref) { methodCalls.add(updater.getWritable(ref)); } } method = updater.getWritable(method); makeMethodVarargs(method); makeMethodCallsVarargs(methodCalls); }