Source:
protected void doMoveOnGenuineVariables(ScoreDirector<Solution_> scoreDirector) { for (int i = 0; i < variableDescriptorList.size(); i++) { GenuineVariableDescriptor<Solution_> variableDescriptor = variableDescriptorList.get(i); Object oldLeftValue = variableDescriptor.getValue(leftEntity); Object oldRightValue = variableDescriptor.getValue(rightEntity); if (!Objects.equals(oldLeftValue, oldRightValue)) { if (!variableDescriptor.isChained()) { scoreDirector.changeVariableFacade(variableDescriptor, leftEntity, oldRightValue); scoreDirector.changeVariableFacade(variableDescriptor, rightEntity, oldLeftValue); } else { Object oldLeftTrailingEntity = oldLeftTrailingEntityMap.get(variableDescriptor); Object oldRightTrailingEntity = oldRightTrailingEntityMap.get(variableDescriptor); if (oldRightValue == leftEntity) { scoreDirector.changeVariableFacade(variableDescriptor, rightEntity, oldLeftValue); scoreDirector.changeVariableFacade(variableDescriptor, leftEntity, rightEntity); if (oldRightTrailingEntity != null) { scoreDirector.changeVariableFacade(variableDescriptor, oldRightTrailingEntity, leftEntity); } } else if (oldLeftValue == rightEntity) { scoreDirector.changeVariableFacade(variableDescriptor, leftEntity, oldRightValue); scoreDirector.changeVariableFacade(variableDescriptor, rightEntity, leftEntity); if (oldLeftTrailingEntity != null) { scoreDirector.changeVariableFacade(variableDescriptor, oldLeftTrailingEntity, rightEntity); } } else { scoreDirector.changeVariableFacade(variableDescriptor, leftEntity, oldRightValue); scoreDirector.changeVariableFacade(variableDescriptor, rightEntity, oldLeftValue); if (oldRightTrailingEntity != null) { scoreDirector.changeVariableFacade(variableDescriptor, oldRightTrailingEntity, leftEntity); } if (oldLeftTrailingEntity != null) { scoreDirector.changeVariableFacade(variableDescriptor, oldLeftTrailingEntity, rightEntity); } } } } } }

Target:
protected void doMoveOnGenuineVariables(ScoreDirector<Solution_> scoreDirector) { for (int i = 0; i < variableDescriptorList.size(); i++) { GenuineVariableDescriptor<Solution_> variableDescriptor = variableDescriptorList.get(i); Object oldLeftValue = variableDescriptor.getValue(leftEntity); Object oldRightValue = variableDescriptor.getValue(rightEntity); if (!Objects.equals(oldLeftValue, oldRightValue)) { if (!variableDescriptor.isChained()) { scoreDirector.changeVariableFacade(variableDescriptor, leftEntity, oldRightValue); scoreDirector.changeVariableFacade(variableDescriptor, rightEntity, oldLeftValue); } else { Object oldLeftTrailingEntity = oldLeftTrailingEntityList.get(i); Object oldRightTrailingEntity = oldRightTrailingEntityList.get(i); if (oldRightValue == leftEntity) { scoreDirector.changeVariableFacade(variableDescriptor, rightEntity, oldLeftValue); scoreDirector.changeVariableFacade(variableDescriptor, leftEntity, rightEntity); if (oldRightTrailingEntity != null) { scoreDirector.changeVariableFacade(variableDescriptor, oldRightTrailingEntity, leftEntity); } } else if (oldLeftValue == rightEntity) { scoreDirector.changeVariableFacade(variableDescriptor, leftEntity, oldRightValue); scoreDirector.changeVariableFacade(variableDescriptor, rightEntity, leftEntity); if (oldLeftTrailingEntity != null) { scoreDirector.changeVariableFacade(variableDescriptor, oldLeftTrailingEntity, rightEntity); } } else { scoreDirector.changeVariableFacade(variableDescriptor, leftEntity, oldRightValue); scoreDirector.changeVariableFacade(variableDescriptor, rightEntity, oldLeftValue); if (oldRightTrailingEntity != null) { scoreDirector.changeVariableFacade(variableDescriptor, oldRightTrailingEntity, leftEntity); } if (oldLeftTrailingEntity != null) { scoreDirector.changeVariableFacade(variableDescriptor, oldLeftTrailingEntity, rightEntity); } } } } } }