public static boolean isInsideMethodBody(@NotNull PsiElement element, @Nullable PsiMethod method) {
    return method != null && PsiTreeUtil.isAncestor(method.getBody(), element, true);
  }
public static boolean isInsideMethodBody(@NotNull PsiElement element, @Nullable PsiMethod method)