// Complex methods
// ************************************************************************
public void assertScore(Solution solution) {
// Get the score before uncorruptedScoreDirector.calculateScore() modifies it
Score score = solution.getScore();
ScoreDirector uncorruptedScoreDirector = buildScoreDirector();
uncorruptedScoreDirector.setWorkingSolution(solution);
Score uncorruptedScore = uncorruptedScoreDirector.calculateScore();
uncorruptedScoreDirector.dispose();
if (!score.equals(uncorruptedScore)) {
throw new IllegalStateException(
"Score corruption: the solution's score (" + score + ") is not the uncorruptedScore ("
+ uncorruptedScore + ").");