AbstractPhaseScope phaseScopeA = mock(AbstractPhaseScope.class);
when(phaseScopeA.getSolverScope()).thenReturn(solverScope);
pillarSelector.phaseStarted(phaseScopeA);
AbstractStepScope stepScopeA1 = mock(AbstractStepScope.class);
when(stepScopeA1.getPhaseScope()).thenReturn(phaseScopeA);
pillarSelector.stepStarted(stepScopeA1);
// nextInt pattern: pillarIndex, subPillarSize, element 0, element 1, element 2, ...
// Expected pillar cache: [a], [b, d], [c, e, f]
when(workingRandom.nextInt(anyInt())).thenReturn(
0, 0, 0, // [a]
2, 1, 0, 0, // [c, e, f]
1, 0, 0, // [b, d]
1, 0, 1); // [b, d]
assertCodesOfNeverEndingPillarSelector(pillarSelector, "[a]", "[c, e]", "[b]", "[d]");
pillarSelector.stepEnded(stepScopeA1);
b.setValue(val3);
f.setValue(val4);
AbstractStepScope stepScopeA2 = mock(AbstractStepScope.class);
when(stepScopeA2.getPhaseScope()).thenReturn(phaseScopeA);
pillarSelector.stepStarted(stepScopeA2);
// nextInt pattern: pillarIndex, subPillarSize, element 0, element 1, element 2, ...
// Expected pillar cache: [a], [b, c, e], [d], [f]
when(workingRandom.nextInt(anyInt())).thenReturn(
3, 0, 0, // [f]
1, 2, 2, 0, 0, // [b, c, e]
1, 0, 0, // [b, c, e]
2, 0, 0); // [d]
assertCodesOfNeverEndingPillarSelector(pillarSelector, "[f]", "[e, c, b]", "[b]", "[d]");
pillarSelector.stepEnded(stepScopeA2);
pillarSelector.phaseEnded(phaseScopeA);
AbstractPhaseScope phaseScopeB = mock(AbstractPhaseScope.class);
when(phaseScopeB.getSolverScope()).thenReturn(solverScope);
pillarSelector.phaseStarted(phaseScopeB);
AbstractStepScope stepScopeB1 = mock(AbstractStepScope.class);
when(stepScopeB1.getPhaseScope()).thenReturn(phaseScopeB);
pillarSelector.stepStarted(stepScopeB1);
// nextInt pattern: pillarIndex, subPillarSize, element 0, element 1, element 2, ...
// Expected pillar cache: [a], [b, c, e], [d], [f]
when(workingRandom.nextInt(anyInt())).thenReturn(
3, 0, 0, // [f]