protected @NotNull <S, SelfS extends FilteredTraverserBase<S, ?>> SelfS mapImpl(@NotNull Function<? super T, ? extends S> function,
                                                                         @NotNull Function<? super S, ? extends T> reverse) {
    //TODO support stateful functions as mapImpl(Function)
    Function<T, JBIterable<T>> baseTree = myMeta::children;
    Condition<? super T> filter = myMeta.filter.and();
    Meta<S> meta = Meta.<S>create(s -> baseTree.fun(reverse.fun(s)).map(function))
      .withRoots(JBIterable.from(getRoots()).map(function))
      .filter(filter == Conditions.alwaysTrue() ? Conditions.alwaysTrue() : o -> filter.value(reverse.fun(o)));
    //noinspection unchecked
    return (SelfS)newInstance((Meta<T>)meta);
  }
protected @NotNull <S, SelfS extends FilteredTraverserBase<S, ?>> SelfS mapImpl(@NotNull Function<? super T, ? extends S> function,
                                                                         @NotNull Function<? super S, ? extends T> reverse)