public static <T> Stream<? extends T> traverse(
            T first, 
            Function<T, Stream<? extends T>> traverser, 
            TraversalOrder traversalOrder) {
        
        requireNonNulls(first, traverser, traversalOrder);
        
        if (traversalOrder == TraversalOrder.BREADTH_FIRST) {
            return traverseBredthFirst(
                first, 
                traverser, 
                Stream.builder()
            ).build();
        } else {
            return traverse(
                first, 
                traverser, 
                traversalOrder, 
                Stream.builder()
            ).build();
        }
    }
The walking order of the tree.
runtime-parent/runtime-config/src/main/java/com/speedment/runtime/config/internal/util/Trees.java