public <T extends NodeDescriptor> void addChild(NodeDescriptor parent, T child, DescriptorKey<T> key) {
    Map<DescriptorKey<? extends NodeDescriptor>, NodeDescriptor> children;

    if (parent == null) {
      children = myRootChildren;
    }
    else {
      children = myChildrenMap.get(parent);
      if (children == null) {
        children = new HashMap<>();
        myChildrenMap.put(parent, children);
      }
    }
    children.put(key, child);
  }
public <T extends NodeDescriptor> void addChild(NodeDescriptor parent, T child, DescriptorKey<T> key)