void () { JBIterable<Integer> dfs = num2Traverser().withTraversal(TreeTraversal.PRE_ORDER_DFS).traverse(); JBIterable<Integer> bfs = num2Traverser().withTraversal(TreeTraversal.TRACING_BFS).traverse(); JBIterable<Integer> postDfs = num2Traverser().withTraversal(TreeTraversal.POST_ORDER_DFS).traverse(); TreeTraversal.TracingIt<Integer> it1 = dfs.typedIterator(); assertEquals(Integer.valueOf(37), it1.skipWhile(Conditions.notEqualTo(37)).next()); TreeTraversal.TracingIt<Integer> it2 = bfs.typedIterator(); assertEquals(Integer.valueOf(37), it2.skipWhile(Conditions.notEqualTo(37)).next()); TreeTraversal.TracingIt<Integer> it3 = postDfs.typedIterator(); assertEquals(Integer.valueOf(37), it3.skipWhile(Conditions.notEqualTo(37)).next()); assertEquals(Arrays.asList(37, 12, 4, 1), it1.backtrace().toList()); assertEquals(Arrays.asList(37, 12, 4, 1), it2.backtrace().toList()); assertEquals(Arrays.asList(37, 12, 4, 1), it3.backtrace().toList()); assertTrue(it1.hasNext()); assertFalse(it2.hasNext()); assertTrue(it3.hasNext()); assertEquals(Arrays.asList(37, 12, 4, 1), it1.backtrace().toList()); assertEquals(Arrays.asList(37, 12, 4, 1), it2.backtrace().toList()); assertEquals(Arrays.asList(37, 12, 4, 1), it3.backtrace().toList()); assertEquals(Integer.valueOf(12), it1.parent()); assertEquals(Integer.valueOf(12), it2.parent()); assertEquals(Integer.valueOf(12), it3.parent()); }