code: public void extractChild( PlanNode child ) {
          if (child.getChildCount() == 0) {
              removeChild(child);
          } else {
              PlanNode grandChild = child.getFirstChild();
              replaceChild(child, grandChild);
          }
      }
docs: Remove the child node from this node, and replace that child with its first child (if there is one).
  
  @param child the child to be extracted; may not be null and must have at most 1 child
  @see #extractFromParent()