void () { Function<Integer, JBIterable<Integer>> traversal = TreeTraversal.INTERLEAVED_DFS.traversal(Functions.fromMap( Map.of( 1, Arrays.asList(1, 2), 2, Arrays.asList(1, 2, 3), 3, Arrays.asList()))); assertEquals(Arrays.asList(1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3), traversal.fun(1).takeWhile(UP_TO(3)).toList()); }