public static boolean insideMethodToBeReplaced(PsiElement methodUsage, final PsiMethod methodToReplaceIn) {
    PsiElement parent = methodUsage.getParent();
    while (parent != null) {
      if (parent.equals(methodToReplaceIn)) {
        return true;
      }
      parent = parent.getParent();
    }
    return false;
  }
public static boolean insideMethodToBeReplaced(PsiElement methodUsage, final PsiMethod methodToReplaceIn)