class DominatorNode<N> {

  protected N gode;
  protected DominatorNode<N> parent;
  protected List<DominatorNode<N>> children;

  protected DominatorNode(N gode) {
    this.gode = gode;
    this.children = new ArrayList<DominatorNode<N>>();
  }

  /**
   * Sets the parent of this node in the DominatorTree. Usually called internally.
   **/
  public void setParent(DominatorNode<N> parent) {
    this.parent = parent;
  }

  /**
   * Adds a child to the internal list of children of this node in tree. Usually called internally.
   **/
  public boolean addChild(DominatorNode<N> child) {<FILL_FUNCTION_BODY>}

  /**
   * Returns the node (from the original DirectedGraph) encapsulated by this DominatorNode.
   **/
  public N getGode() {
    return gode;
  }

  /**
   * Returns the parent of the node in the DominatorTree.
   **/
  public DominatorNode<N> getParent() {
    return parent;
  }

  /**
   * Returns a backed list of the children of this node in the DominatorTree.
   **/
  public List<DominatorNode<N>> getChildren() {
    return children;
  }

  /**
   * Returns true if this node is the head of its DominatorTree.
   **/
  public boolean isHead() {
    return parent == null;
  }

  /**
   * Returns true if this node is a tail of its DominatorTree.
   **/
  public boolean isTail() {
    return children.isEmpty();
  }

  @Override
  public String toString() {
    // *** FIXME: Print info about parent and children
    return gode.toString();
  }
}

    if (children.contains(child)) {
      return false;
    } else {
      children.add(child);
      return true;
    }
  
<no_super_class>