code: public List<? extends ListCommand> repairRemoteCommandVersion(
              final List<? extends ListCommand> indexRepairedRemoteCommands,
              final List<ListCommand> versionRepairedLocalCommands) {
  
          final int commandCount = indexRepairedRemoteCommands.size();
          final ListCommand lastLocalCommand = versionRepairedLocalCommands.get(versionRepairedLocalCommands.size() - 1);
  
          if (commandCount == 0) {
              return asList(new RemoveFromList(lastLocalCommand.getListId(), new ListVersionChange(randomUUID(),
                      lastLocalCommand.getListVersionChange().getToVersion()), 0, 0));
          }
  
          final List<ListCommand> repaired = new ArrayList<ListCommand>(commandCount);
          for (int i = 0; i < commandCount - 1; i++) {
              repaired.add(indexRepairedRemoteCommands.get(i));
          }
          repaired.add(repairCommand(indexRepairedRemoteCommands.get(commandCount - 1), randomUUID(), lastLocalCommand
                  .getListVersionChange().getToVersion()));
  
          return repaired;
      }
docs: Updates the version of the remote commands that should be executed locally to ensure that the local list version
  equals the version that is resent to the server when they are executed.
  
  @param indexRepairedRemoteCommands
  The remote commands thats indices where already repaired. This list can be empty.
  @param versionRepairedLocalCommands
  The local commands that should be resent to the server thats version was already repaired by this
  class. This queue must contain at least one element.
  @return The remote commands with repaired list versions.