acceptor.phaseStarted(phaseScope);
// lateScore = -1000
LocalSearchStepScope stepScope0 = new LocalSearchStepScope(phaseScope);
stepScope0.setStepIndex(0);
LocalSearchMoveScope moveScope1 = buildMoveScope(stepScope0, -500);
assertEquals(true, acceptor.isAccepted(buildMoveScope(stepScope0, -900)));
assertEquals(true, acceptor.isAccepted(moveScope1));
assertEquals(true, acceptor.isAccepted(buildMoveScope(stepScope0, -800)));
assertEquals(false, acceptor.isAccepted(buildMoveScope(stepScope0, -2000)));
assertEquals(true, acceptor.isAccepted(buildMoveScope(stepScope0, -1000)));
assertEquals(true, acceptor.isAccepted(buildMoveScope(stepScope0, -900))); // Repeated call
stepScope0.setStep(moveScope1.getMove());
stepScope0.setScore(moveScope1.getScore());
solverScope.setBestScore(moveScope1.getScore());
acceptor.stepEnded(stepScope0);
// lateScore = -1000
LocalSearchStepScope stepScope1 = new LocalSearchStepScope(phaseScope);
stepScope1.setStepIndex(1);
LocalSearchMoveScope moveScope2 = buildMoveScope(stepScope1, -700);
assertEquals(true, acceptor.isAccepted(buildMoveScope(stepScope1, -900)));
assertEquals(false, acceptor.isAccepted(buildMoveScope(stepScope1, -2000)));
assertEquals(true, acceptor.isAccepted(moveScope2));
assertEquals(true, acceptor.isAccepted(buildMoveScope(stepScope1, -1000)));
assertEquals(false, acceptor.isAccepted(buildMoveScope(stepScope1, -1001)));
assertEquals(true, acceptor.isAccepted(buildMoveScope(stepScope0, -900))); // Repeated call
stepScope1.setStep(moveScope2.getMove());
stepScope1.setScore(moveScope2.getScore());
// bestScore unchanged
acceptor.stepEnded(stepScope1);
// lateScore = -1000
LocalSearchStepScope stepScope2 = new LocalSearchStepScope(phaseScope);
stepScope2.setStepIndex(2);
LocalSearchMoveScope moveScope4 = buildMoveScope(stepScope1, -400);
assertEquals(true, acceptor.isAccepted(buildMoveScope(stepScope2, -900)));
assertEquals(false, acceptor.isAccepted(buildMoveScope(stepScope2, -2000)));
assertEquals(false, acceptor.isAccepted(buildMoveScope(stepScope2, -1001)));
assertEquals(true, acceptor.isAccepted(buildMoveScope(stepScope2, -1000)));
assertEquals(true, acceptor.isAccepted(moveScope4));
assertEquals(true, acceptor.isAccepted(buildMoveScope(stepScope0, -900))); // Repeated call
stepScope2.setStep(moveScope4.getMove());
stepScope2.setScore(moveScope4.getScore());
solverScope.setBestScore(moveScope4.getScore());
acceptor.stepEnded(stepScope2);
// lateScore = -500
LocalSearchStepScope stepScope3 = new LocalSearchStepScope(phaseScope);
stepScope3.setStepIndex(3);
LocalSearchMoveScope moveScope3 = buildMoveScope(stepScope1, -200);
assertEquals(false, acceptor.isAccepted(buildMoveScope(stepScope3, -900)));
assertEquals(true, acceptor.isAccepted(buildMoveScope(stepScope3, -500)));
assertEquals(false, acceptor.isAccepted(buildMoveScope(stepScope3, -501)));
assertEquals(true, acceptor.isAccepted(moveScope3));
assertEquals(false, acceptor.isAccepted(buildMoveScope(stepScope3, -2000)));
assertEquals(false, acceptor.isAccepted(buildMoveScope(stepScope0, -900))); // Repeated call
stepScope3.setStep(moveScope3.getMove());
stepScope3.setScore(moveScope3.getScore());
solverScope.setBestScore(moveScope3.getScore());
acceptor.stepEnded(stepScope3);
// lateScore = -700 (not the best score of -500!)
LocalSearchStepScope stepScope4 = new LocalSearchStepScope(phaseScope);
stepScope4.setStepIndex(4);
LocalSearchMoveScope moveScope1Again = buildMoveScope(stepScope1, -300);
assertEquals(true, acceptor.isAccepted(buildMoveScope(stepScope4, -700)));
assertEquals(true, acceptor.isAccepted(moveScope1Again));
assertEquals(true, acceptor.isAccepted(buildMoveScope(stepScope4, -500)));
assertEquals(false, acceptor.isAccepted(buildMoveScope(stepScope4, -2000)));
assertEquals(false, acceptor.isAccepted(buildMoveScope(stepScope4, -701)));
assertEquals(true, acceptor.isAccepted(buildMoveScope(stepScope0, -700))); // Repeated call
stepScope4.setStep(moveScope1Again.getMove());
stepScope4.setScore(moveScope1Again.getScore());
// bestScore unchanged
acceptor.stepEnded(stepScope4);
// lateScore = -400
LocalSearchStepScope stepScope5 = new LocalSearchStepScope(phaseScope);
stepScope5.setStepIndex(5);
LocalSearchMoveScope moveScope2Again = buildMoveScope(stepScope1, -300);
assertEquals(false, acceptor.isAccepted(buildMoveScope(stepScope5, -401)));
assertEquals(true, acceptor.isAccepted(buildMoveScope(stepScope5, -400)));
assertEquals(true, acceptor.isAccepted(moveScope2Again));
assertEquals(false, acceptor.isAccepted(buildMoveScope(stepScope5, -2000)));
assertEquals(false, acceptor.isAccepted(buildMoveScope(stepScope5, -600)));
assertEquals(false, acceptor.isAccepted(buildMoveScope(stepScope0, -401))); // Repeated call
stepScope5.setStep(moveScope2Again.getMove());
stepScope5.setScore(moveScope2Again.getScore());
// bestScore unchanged
acceptor.stepEnded(stepScope5);
acceptor.phaseEnded(phaseScope);
}