code: public AddToList repairCommand(final AddToList toRepair, final RemoveFromList repairAgainst) {
          final int indicesBefore = toRepair.getPosition() - repairAgainst.getStartPosition();
          if (indicesBefore <= 0) {
              return toRepair;
          }
          final int indicesToDecrese = indicesBefore < repairAgainst.getRemoveCount() ? indicesBefore : repairAgainst
                  .getRemoveCount();
          return createCommand(toRepair, toRepair.getPosition() - indicesToDecrese);
      }
docs: Repairs an {@link AddToList} in relation to a {@link RemoveFromList} command.
  
  @param toRepair
  The command to repair.
  @param repairAgainst
  The command to repair against.
  @return The repaired command.