this.functionRing = new FunctionRing(branchFunctions);
TraversalHelper.verifySideEffectKeyIsNotAStepLabel(this.sideEffectKey, this.traversal);
this.traversal.sideEffects().registerSupplierIfAbsent(this.sideEffectKey, Tree::new);
this.setConsumer(traverser -> {
Tree depth = this.getTraversal().sideEffects().get(this.sideEffectKey);
final Path path = traverser.path();
for (int i = 0; i < path.size(); i++) {
final Object object = functionRing.next().apply(path.get(i));
if (!depth.containsKey(object))
depth.put(object, new Tree<>());
depth = (Tree) depth.get(object);
}
this.functionRing.reset();