private static <I, V> Node<V> get(@NotNull Map<I, Node<V>> tree, @NotNull I id) {
      Node<V> node = tree.get(id);
      if (node == null) {
        node = new Node<>();
        tree.put(id, node);
      }
      return node;
    }
private static <I, V> Node<V> get(@NotNull Map<I, Node<V>> tree, @NotNull I id)