code: private GBSNode lastInList(
      GBSNode       p)
    {
      GBSNode q = p;
      p = p.rightChild();
      while (p != null)
      {
        q = p;
        p = p.rightChild();
      }
      return q;
    }
docs: Return the last node in a linear list of nodes linked together
  by their right child pointer.