TreeModel implements Serializable { public boolean inTree(NodeModel<T> starNode, NodeModel<T> deleteNote) { boolean in = false; Deque<NodeModel<T>> queue = new ArrayDeque<>(); NodeModel<T> rootNode = starNode; queue.add(rootNode); while (!queue.isEmpty()) { rootNode = (NodeModel<T>) queue.poll(); if (rootNode == deleteNote) { in = true; } LinkedList<NodeModel<T>> childNodes = rootNode.getChildNodes(); if (childNodes.size() > 0) { for (NodeModel<T> item : childNodes) { queue.add(item); } } } return in; } TreeModel(NodeModel<T> rootNode); void addNode(NodeModel<T> start, NodeModel<T>... nodes); boolean removeNode(NodeModel<T> starNode, NodeModel<T> deleteNote); boolean inTree(NodeModel<T> starNode, NodeModel<T> deleteNote); NodeModel<T> getRootNode(); void setRootNode(NodeModel<T> rootNode); ArrayList<NodeModel<T>> getAllLowNodes(NodeModel<T> addNode); ArrayList<NodeModel<T>> getAllPreNodes(NodeModel<T> addNode); LinkedList<NodeModel<T>> getNodeChildNodes(NodeModel<T> node); void ergodicTreeInDeep(int msg); void ergodicTreeInWith(int msg); void addForTreeItem(ForTreeItem<NodeModel<T>> forTreeItem); Object deepClone();  }
@Test public void inTree() throws Exception { }