SelectorTestUtils.mockMethodGetTrailingEntity(scoreDirector, variableDescriptor,
new TestdataChainedEntity[]{a1, a2, a3, a4, a5, b1, b2, b3});
SubChainSwapMove move = new SubChainSwapMove(variableDescriptor, new SubChain(Arrays.<Object>asList(a2, a3, a4)),
new SubChain(Arrays.<Object>asList(b1, b2)));
Move undoMove = move.createUndoMove(scoreDirector);
move.doMove(scoreDirector);
SelectorTestUtils.assertChain(a0, a1, b1, b2, a5);
SelectorTestUtils.assertChain(b0, a2, a3, a4, b3);
verify(scoreDirector).beforeVariableChanged(a2, "chainedObject");
verify(scoreDirector).afterVariableChanged(a2, "chainedObject");
verify(scoreDirector).beforeVariableChanged(a3, "chainedObject");
verify(scoreDirector).afterVariableChanged(a3, "chainedObject");
verify(scoreDirector).beforeVariableChanged(a4, "chainedObject");
verify(scoreDirector).afterVariableChanged(a4, "chainedObject");
verify(scoreDirector, atLeastOnce()).beforeVariableChanged(a5, "chainedObject");
verify(scoreDirector, atLeastOnce()).afterVariableChanged(a5, "chainedObject");
verify(scoreDirector, atLeastOnce()).beforeVariableChanged(b1, "chainedObject");
verify(scoreDirector, atLeastOnce()).afterVariableChanged(b1, "chainedObject");
verify(scoreDirector).beforeVariableChanged(b2, "chainedObject");
verify(scoreDirector).afterVariableChanged(b2, "chainedObject");
verify(scoreDirector).beforeVariableChanged(b3, "chainedObject");
verify(scoreDirector).afterVariableChanged(b3, "chainedObject");
undoMove.doMove(scoreDirector);
SelectorTestUtils.assertChain(a0, a1, a2, a3, a4, a5);
SelectorTestUtils.assertChain(b0, b1, b2, b3);
}