I have a findNode method that finds a target string in a treenode. The issue I am having is that my recursive method only seems to go down one branch of the tree and not cover the hole tree like I thought it should. If you require anymore code please ask.
public GeneralTreeNode findNode(String targetName) {
// name is the current name of the node
if(targetName.equals(this.name)) return this;
// children is a HashSet of all the nodes children
for(GeneralTreeNode child : children) return child.findNode(targetName);
// no node containing the string could be found
return null;
}