private static boolean isNodeParentMethod(@NotNull ASTNode node) {
    return node.getTreeParent() != null && node.getTreeParent().getElementType() == JavaElementType.METHOD;
  }
private static boolean isNodeParentMethod(@NotNull ASTNode node)