void () { JBIterable<String> dfs = num2Traverser().withTraversal(TreeTraversal.PRE_ORDER_DFS).traverse().map(Functions.TO_STRING()); JBIterable<String> bfs = num2Traverser().withTraversal(TreeTraversal.TRACING_BFS).traverse().map(Functions.TO_STRING()); TreeTraversal.TracingIt<String> it1 = dfs.typedIterator(); it1.skipWhile(Conditions.notEqualTo("37")).next(); TreeTraversal.TracingIt<String> it2 = bfs.typedIterator(); it2.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("12", it1.parent()); assertEquals("12", it2.parent()); }