private @Nullable List<Node> load(int count, @NotNull IntFunction<?> childGetter) {
      if (count < 0) LOG.warn("illegal child count: " + count);
      if (count <= 0) return emptyList();

      Set<Object> set = count == 1 ? new SmartHashSet<>() : new HashSet<>(count);
      List<Node> children = new ArrayList<>(count);
      for (int i = 0; i < count; i++) {
        ProgressManager.checkCanceled();
        if (isObsolete()) return null;
        Object child = childGetter.apply(i);
        if (child == null) {
          LOG.warn("ignore null child at " + i);
        }
        else if (!set.add(child)) {
          LOG.warn("ignore duplicated child at " + i + ": " + child);
        }
        else {
          if (isObsolete()) return null;
          children.add(new Node(child, LeafState.get(child, model)));
        }
      }
      return children;
    }
private @Nullable List<Node> load(int count, @NotNull IntFunction<?> childGetter)