private static @Nullable IElementType getNodeElementType(Block parent) {
    if (parent == null) return null;
    ASTBlock it = ObjectUtils.tryCast(parent, ASTBlock.class);
    if (it == null) return null;
    ASTNode node = it.getNode();
    if (node == null) return null;
    return node.getElementType();
  }
private static @Nullable IElementType getNodeElementType(Block parent)