private static boolean isAutoExpandAllowed(@NotNull JTree tree, @NotNull Object node) {
    Function<Object, Boolean> filter = ClientProperty.get(tree, AUTO_EXPAND_FILTER);
    if (filter != null) {
      return !filter.apply(node);
    }
    else if (node instanceof AbstractTreeNode<?> treeNode) {
      return treeNode.isAutoExpandAllowed();
    }
    else {
      return true;
    }
  }
private static boolean isAutoExpandAllowed(@NotNull JTree tree, @NotNull Object node)