private void addToJoinedChildren(int index, int childId) {
    if (myJoinedChildrenList.size() == index) {
      myJoinedChildrenList.add(childId);
    }
    else {
      assert myJoinedChildrenList.get(index) == 0;
      myJoinedChildrenList.set(index, childId);
    }
  }
private void addToJoinedChildren(int index, int childId)