public TreeNode<T> attach(final TreeNode<T> child) {
		requireNonNull(child);

		if (child._parent == this) {
			insert(childCount() - 1, child);
		} else {
			insert(childCount(), child);
		}

		return this;
	}
Remove the given {@code child} from its parent and makes it a child of
this node by adding it to the end of this node's child array.

@param child the new child added to this node
@return {@code this} tree-node, for method chaining
@throws NullPointerException if the given {@code child} is {@code null}
jenetics.ext/src/main/java/io/jenetics/ext/util/TreeNode.java