code: public static <T> StreamEx<T> ofTree(T root, Function<T, Stream<T>> mapper) {
          TreeSpliterator<T, T> spliterator = new TreeSpliterator.Plain<>(root, mapper);
          return new StreamEx<>(spliterator, StreamContext.SEQUENTIAL.onClose(spliterator::close));
      }
docs: Return a new {@link StreamEx} containing all the nodes of tree-like data
  structure in depth-first order.
  
  <p>
  The streams created by mapper may be automatically
  {@link java.util.stream.BaseStream#close() closed} after its contents
  already consumed and unnecessary anymore. It's not guaranteed that all
  created streams will be closed during the stream terminal operation. If
  it's necessary to close all the created streams, call the {@code close()}
  method of the resulting stream returned by {@code ofTree()}.
  
  @param <T> the type of tree nodes
  @param root root node of the tree
  @param mapper a non-interfering, stateless function to apply to each tree
  node which returns null for leaf nodes or stream of direct
  children for non-leaf nodes.
  @return the new sequential ordered stream
  @since 0.2.2
  @see EntryStream#ofTree(Object, BiFunction)
  @see #ofTree(Object, Class, Function)