class ChainedChangeMove<Solution_> extends ChangeMove<Solution_> {

    protected final Object oldTrailingEntity;
    protected final Object newTrailingEntity;

    public ChainedChangeMove(GenuineVariableDescriptor<Solution_> variableDescriptor, Object entity, Object toPlanningValue,
            SingletonInverseVariableSupply inverseVariableSupply) {
        super(variableDescriptor, entity, toPlanningValue);
        oldTrailingEntity = inverseVariableSupply.getInverseSingleton(entity);
        newTrailingEntity = toPlanningValue == null ? null
                : inverseVariableSupply.getInverseSingleton(toPlanningValue);
    }

    public ChainedChangeMove(GenuineVariableDescriptor<Solution_> variableDescriptor, Object entity, Object toPlanningValue,
            Object oldTrailingEntity, Object newTrailingEntity) {
        super(variableDescriptor, entity, toPlanningValue);
        this.oldTrailingEntity = oldTrailingEntity;
        this.newTrailingEntity = newTrailingEntity;
    }

    // ************************************************************************
    // Worker methods
    // ************************************************************************

    @Override
    public boolean isMoveDoable(ScoreDirector<Solution_> scoreDirector) {
        return super.isMoveDoable(scoreDirector)
                && !Objects.equals(entity, toPlanningValue);
    }

    @Override
    public ChainedChangeMove<Solution_> createUndoMove(ScoreDirector<Solution_> scoreDirector) {
        Object oldValue = variableDescriptor.getValue(entity);
        return new ChainedChangeMove<>(variableDescriptor, entity, oldValue, newTrailingEntity, oldTrailingEntity);
    }

    @Override
    protected void doMoveOnGenuineVariables(ScoreDirector<Solution_> scoreDirector) {<FILL_FUNCTION_BODY>}

    @Override
    public ChainedChangeMove<Solution_> rebase(ScoreDirector<Solution_> destinationScoreDirector) {
        return new ChainedChangeMove<>(variableDescriptor,
                destinationScoreDirector.lookUpWorkingObject(entity),
                destinationScoreDirector.lookUpWorkingObject(toPlanningValue),
                destinationScoreDirector.lookUpWorkingObject(oldTrailingEntity),
                destinationScoreDirector.lookUpWorkingObject(newTrailingEntity));
    }

}

        InnerScoreDirector<Solution_, ?> innerScoreDirector = (InnerScoreDirector<Solution_, ?>) scoreDirector;
        Object oldValue = variableDescriptor.getValue(entity);
        // Close the old chain
        if (oldTrailingEntity != null) {
            innerScoreDirector.changeVariableFacade(variableDescriptor, oldTrailingEntity, oldValue);
        }
        // Change the entity
        innerScoreDirector.changeVariableFacade(variableDescriptor, entity, toPlanningValue);
        // Reroute the new chain
        if (newTrailingEntity != null) {
            innerScoreDirector.changeVariableFacade(variableDescriptor, newTrailingEntity, entity);
        }
    
<methods>public void <init>(GenuineVariableDescriptor<Solution_>, java.lang.Object, java.lang.Object) ,public ChangeMove<Solution_> createUndoMove(ScoreDirector<Solution_>) ,public boolean equals(java.lang.Object) ,public java.lang.Object getEntity() ,public Collection<? extends java.lang.Object> getPlanningEntities() ,public Collection<? extends java.lang.Object> getPlanningValues() ,public java.lang.String getSimpleMoveTypeDescription() ,public java.lang.Object getToPlanningValue() ,public java.lang.String getVariableName() ,public int hashCode() ,public boolean isMoveDoable(ScoreDirector<Solution_>) ,public ChangeMove<Solution_> rebase(ScoreDirector<Solution_>) ,public java.lang.String toString() <variables>protected final non-sealed java.lang.Object entity,protected final non-sealed java.lang.Object toPlanningValue,protected final non-sealed GenuineVariableDescriptor<Solution_> variableDescriptor