AbstractPhaseScope phaseScopeA = mock(AbstractPhaseScope.class);
when(phaseScopeA.getSolverScope()).thenReturn(solverScope);
when(phaseScopeA.getScoreDirector()).thenReturn(scoreDirector);
entitySelector.phaseStarted(phaseScopeA);
AbstractStepScope stepScopeA1 = mock(AbstractStepScope.class);
when(stepScopeA1.getPhaseScope()).thenReturn(phaseScopeA);
when(stepScopeA1.getScoreDirector()).thenReturn(scoreDirector);
entitySelector.stepStarted(stepScopeA1);
assertCodesOfNeverEndingOfEntitySelector(entitySelector, 3L, "e2", "e1", "e1", "e3");
entitySelector.stepEnded(stepScopeA1);
when(entityDescriptor.extractEntities(workingSolution)).thenReturn(Arrays.<Object>asList(
new TestdataEntity("f1"), new TestdataEntity("f2"), new TestdataEntity("f3")));
when(scoreDirector.getWorkingEntityListRevision()).thenReturn(8L);
when(scoreDirector.isWorkingEntityListDirty(7L)).thenReturn(true);
when(scoreDirector.isWorkingEntityListDirty(8L)).thenReturn(false);
AbstractStepScope stepScopeA2 = mock(AbstractStepScope.class);
when(stepScopeA2.getPhaseScope()).thenReturn(phaseScopeA);
when(stepScopeA2.getScoreDirector()).thenReturn(scoreDirector);
entitySelector.stepStarted(stepScopeA2);
assertCodesOfNeverEndingOfEntitySelector(entitySelector, 3L, "f2", "f3");
entitySelector.stepEnded(stepScopeA2);
entitySelector.phaseEnded(phaseScopeA);
AbstractPhaseScope phaseScopeB = mock(AbstractPhaseScope.class);
when(phaseScopeB.getSolverScope()).thenReturn(solverScope);
when(phaseScopeB.getScoreDirector()).thenReturn(scoreDirector);
entitySelector.phaseStarted(phaseScopeB);
AbstractStepScope stepScopeB1 = mock(AbstractStepScope.class);
when(stepScopeB1.getPhaseScope()).thenReturn(phaseScopeB);
when(stepScopeB1.getScoreDirector()).thenReturn(scoreDirector);
entitySelector.stepStarted(stepScopeB1);
assertCodesOfNeverEndingOfEntitySelector(entitySelector, 3L, "f3");
entitySelector.stepEnded(stepScopeB1);
AbstractStepScope stepScopeB2 = mock(AbstractStepScope.class);
when(stepScopeB2.getPhaseScope()).thenReturn(phaseScopeB);
when(stepScopeB2.getScoreDirector()).thenReturn(scoreDirector);
entitySelector.stepStarted(stepScopeB2);
assertCodesOfNeverEndingOfEntitySelector(entitySelector, 3L, "f2");
entitySelector.stepEnded(stepScopeB2);
when(entityDescriptor.extractEntities(workingSolution)).thenReturn(Arrays.<Object>asList(
new TestdataEntity("e1"), new TestdataEntity("e2"), new TestdataEntity("e3")));
when(scoreDirector.getWorkingEntityListRevision()).thenReturn(9L);
when(scoreDirector.isWorkingEntityListDirty(8L)).thenReturn(true);
when(scoreDirector.isWorkingEntityListDirty(9L)).thenReturn(false);
AbstractStepScope stepScopeB3 = mock(AbstractStepScope.class);
when(stepScopeB3.getPhaseScope()).thenReturn(phaseScopeB);
when(stepScopeB3.getScoreDirector()).thenReturn(scoreDirector);
entitySelector.stepStarted(stepScopeB3);
assertCodesOfNeverEndingOfEntitySelector(entitySelector, 3L, "e1");
entitySelector.stepEnded(stepScopeB3);
entitySelector.phaseEnded(phaseScopeB);