docs: private static <T, R> Choice<State<R>> chooseSubtrees(
        State<?> state,
        Function<State<?>, Choice<? extends State<? extends T>>> choice1,
        Function<T, R> finalizer) {
      return choice1.apply(state).transform(s -> s.withResult(finalizer.apply(s.result())));
    }