### Question:
Tree { public void middlePrint(Node tnode) { if (tnode.getChildren() == null) { return; } for (Node node : tnode.getChildren()) { System.out.println(node.getFilename()); middlePrint(node); } } Tree();  Tree(String text); void createTree(List<Node> nodes); void middlePrint(Node tnode); @Transient List<Node> getLeafList(); String getHtml(Node tnode); boolean checkExist(Node tnode, String text); Node getRoot(); void setRoot(Node root);  }### Answer:
@Test public void testMiddlePrint() { final Tree tree = new Tree(); tree.setRoot(null); final Node node = new Node(); final ArrayList<Node> arrayList = new ArrayList<Node>(); arrayList.add(new Node(0, 0, "foo", 0l, 0)); arrayList.add(new Node(0, 0, "bar", 0l, 0)); node.setChildren(arrayList); tree.middlePrint(node); assertEquals("foo\nbar\n", outputStream.toString()); }