public static <T, B> TreeNode<B> ofTree(
		final Tree<? extends T, ?> tree,
		final Function<? super T, ? extends B> mapper
	) {
		final TreeNode<B> target = of(mapper.apply(tree.value()));
		copy(tree, target, mapper);
		return target;
	}
Return a new {@code TreeNode} from the given source {@code tree}. The
whole tree is copied.

@param tree the source tree the new tree-node is created from
@param mapper the tree value mapper function
@param <T> the current tree value type
@param <B> the mapped tree value type
@return a new {@code TreeNode} from the given source {@code tree}
@throws NullPointerException if one of the arguments is {@code null}
jenetics.ext/src/main/java/io/jenetics/ext/util/TreeNode.java