code: private void addUniqueNodes(Map<TreeNode,TreeNode> nodes, TreeNode newNode) {
  		if (nodes.put(newNode,newNode) != null) {
  			throw new RuntimeException(String.format(
  					"Node used more than once in tree: %s", newNode));
  		}
  		for (TreeNode n : tree.getChildren(newNode)) {
  			addUniqueNodes(nodes,n);
  		}
  	}
docs: checkTree