code: public void replaceChild(Node current, Node with) {
          double currentSplit = nodeSplits.get(current);
          int index = children.indexOf(current);
          children.remove(current);
          addChild(with, index, currentSplit);
          notifyStateChange();
      }
docs: Replaces a child node with another node
  @param current The child node which should be replaced
  @param with    The node that the child node should be replaced with