@Override
public void test() {
Application<List<Integer>, ProtocolBuilderNumeric> testApplication = root -> root
.seq(seq -> {
return new IterationState(0, new ArrayList<>());
}).whileLoop(
(state) -> state.round < numIterations,
(seq, state) -> {
List<Integer> roundsSoFar = state.rounds;
roundsSoFar.add(state.round);
return new IterationState(state.round + 1, roundsSoFar);
}).seq((seq, state) -> () -> state.rounds);
List<Integer> actual = runApplication(testApplication);
Assert.assertEquals(expected, actual);
}
};