I am investigationg step builder patterns in Kotlin and have a requirement where some of the steps are repeatable or loop able as follows:-
I have a Map<Header, List> and would like to support the following use cases
Steps
1). User has to add a header first
2). User has to add atleast one item which will added to the current headers list
3.a). the user can now choose to build the map and this is a terminal step.
3.b). the user can choose to add another header and item(s) e.g. repeat steps 1).& 2).
is it possible to implement this in a kotlin step builder pattern?