TestdataChainedEntity.class, "chainedObject");
when(variableDescriptor.isChained()).thenReturn(true);
ScoreDirector scoreDirector = mock(ScoreDirector.class);
TestdataChainedAnchor a0 = new TestdataChainedAnchor("a0");
TestdataChainedEntity a1 = new TestdataChainedEntity("a1", a0);
TestdataChainedEntity a2 = new TestdataChainedEntity("a2", a1);
TestdataChainedEntity a3 = new TestdataChainedEntity("a3", a2);
TestdataChainedEntity a4 = new TestdataChainedEntity("a4", a3);
TestdataChainedAnchor b0 = new TestdataChainedAnchor("b0");
TestdataChainedEntity b1 = new TestdataChainedEntity("b1", b0);
TestdataChainedEntity b2 = new TestdataChainedEntity("b2", b1);
SelectorTestUtils.mockMethodGetTrailingEntity(scoreDirector, variableDescriptor,
new TestdataChainedEntity[]{a1, a2, a3, a4, b1, b2});
ValueSelector valueSelector = SelectorTestUtils.mockValueSelector(variableDescriptor,
a0, a1, a2, a3, a4, b0, b1, b2);
DefaultSubChainSelector subChainSelector = new DefaultSubChainSelector(valueSelector, false, 1);
DefaultSolverScope solverScope = mock(DefaultSolverScope.class);
when(solverScope.getScoreDirector()).thenReturn(scoreDirector);
subChainSelector.solvingStarted(solverScope);
AbstractSolverPhaseScope phaseScopeA = mock(AbstractSolverPhaseScope.class);
when(phaseScopeA.getSolverScope()).thenReturn(solverScope);
subChainSelector.phaseStarted(phaseScopeA);
AbstractStepScope stepScopeA1 = mock(AbstractStepScope.class);
when(stepScopeA1.getPhaseScope()).thenReturn(phaseScopeA);
subChainSelector.stepStarted(stepScopeA1);
runAssertsOriginal1(subChainSelector);
subChainSelector.stepEnded(stepScopeA1);
a4.setChainedObject(a2);
a3.setChainedObject(b1);
b2.setChainedObject(a3);
AbstractStepScope stepScopeA2 = mock(AbstractStepScope.class);
when(stepScopeA2.getPhaseScope()).thenReturn(phaseScopeA);
subChainSelector.stepStarted(stepScopeA2);
runAssertsOriginal2(subChainSelector);