private static <T> Stream.Builder<? extends T> traverseBredthFirst(
            T first, 
            Function<T, Stream<? extends T>> traverser, 
            Stream.Builder<T> builder) {
        
        requireNonNulls(first, traverser, builder);
        
        if (first == null) {
            return builder;
        }
        
        final Queue<T> q = new ArrayDeque<>();
        q.add(first);
        
        while (!q.isEmpty()) {
            final T node = q.poll();
            builder.add(node);
            traverser
                .apply(node)
                .filter(Objects::nonNull)
                .forEach(q::add);
        }
        
        return builder;
    }
The walking order of the tree.
runtime-parent/runtime-config/src/main/java/com/speedment/runtime/config/internal/util/Trees.java