private @Nullable NodeStructure getNodeStructure(@NotNull Obsolescent obsolescent, @NotNull Object node) {
    assert invoker != null ? invoker.isValidThread() : EventQueue.isDispatchThread();
    if (obsolescent.isObsolete()) return null;
    LeafState state = LeafState.get(node, model);
    if (obsolescent.isObsolete()) return null;
    List<NodeContent> list = emptyList();
    if (state != LeafState.ALWAYS) {
      if (model instanceof ChildrenProvider<?> provider) {
        List<?> children = provider.getChildren(node);
        if (children == null) throw new ProcessCanceledException();
        list = getChildren(obsolescent, children.size(), children::get);
      }
      else {
        list = getChildren(obsolescent, model.getChildCount(node), index -> model.getChild(node, index));
      }
    }
    if (state == LeafState.ASYNC) state = list.isEmpty() ? LeafState.ALWAYS : LeafState.NEVER;
    return new NodeStructure(new NodeContent(node, state), list);
  }
private @Nullable NodeStructure getNodeStructure(@NotNull Obsolescent obsolescent, @NotNull Object node)