void (@NotNull PsiMethod method, @NotNull List<PsiMethod> superMethods, @NotNull List<? super PsiElement> result) { PsiCodeBlock body = method.getBody(); if (body == null || superMethods.isEmpty()) return; body.accept(new JavaRecursiveElementWalkingVisitor() { @Override public void visitMethodCallExpression(@NotNull PsiMethodCallExpression expression) { PsiMethod called = expression.resolveMethod(); if (superMethods.contains(called)) { result.add(expression); } super.visitMethodCallExpression(expression); } }); }