boolean (final PsiElement element, final PsiMethod setupMethod) { if (element instanceof PsiMethodCallExpression) { final PsiMethod psiMethod = ((PsiMethodCallExpression)element).resolveMethod(); if (setupMethod.equals(psiMethod)){ return true; } } final PsiElement[] children = element.getChildren(); for (int i = children.length - 1; i >= 0; i--) { if (containsMethodIdentifier(children[i], setupMethod)) { return true; } } return false; }