@Test public void repairedLocalListVersionsAllDifferFromTheirOriginial() { cut.repairLocalCommandsVersion(localCommands, someRemoteCommand); assertThat(localCommands).hasSize(3); final ListVersionChange version1 = localCommands.poll().getListVersionChange(); assertThat(version1.getFromVersion()).isNotEqualTo(addToList.getListVersionChange().getFromVersion()); assertThat(version1.getToVersion()).isNotEqualTo(addToList.getListVersionChange().getToVersion()); final ListVersionChange version2 = localCommands.poll().getListVersionChange(); assertThat(version2.getFromVersion()).isNotEqualTo(removeFromList.getListVersionChange().getFromVersion()); assertThat(version2.getToVersion()).isNotEqualTo(removeFromList.getListVersionChange().getToVersion()); final ListVersionChange version3 = localCommands.poll().getListVersionChange(); assertThat(version3.getFromVersion()).isNotEqualTo(replaceInList.getListVersionChange().getFromVersion()); assertThat(version3.getToVersion()).isNotEqualTo(replaceInList.getListVersionChange().getToVersion()); }
public void repairLocalCommandsVersion(final Queue<ListCommand> localCommands, final ListCommand originalRemoteCommand) { localCommands.add(repairCommand(localCommands.poll(), originalRemoteCommand.getListVersionChange() .getToVersion(), randomUUID())); final int count = localCommands.size(); for (int i = 1; i < count; i++) { localCommands.add(repairCommand(localCommands.poll(), randomUUID(), randomUUID())); } }
ListCommandVersionRepairer { public void repairLocalCommandsVersion(final Queue<ListCommand> localCommands, final ListCommand originalRemoteCommand) { localCommands.add(repairCommand(localCommands.poll(), originalRemoteCommand.getListVersionChange() .getToVersion(), randomUUID())); final int count = localCommands.size(); for (int i = 1; i < count; i++) { localCommands.add(repairCommand(localCommands.poll(), randomUUID(), randomUUID())); } } }
ListCommandVersionRepairer { public void repairLocalCommandsVersion(final Queue<ListCommand> localCommands, final ListCommand originalRemoteCommand) { localCommands.add(repairCommand(localCommands.poll(), originalRemoteCommand.getListVersionChange() .getToVersion(), randomUUID())); final int count = localCommands.size(); for (int i = 1; i < count; i++) { localCommands.add(repairCommand(localCommands.poll(), randomUUID(), randomUUID())); } }  }
ListCommandVersionRepairer { public void repairLocalCommandsVersion(final Queue<ListCommand> localCommands, final ListCommand originalRemoteCommand) { localCommands.add(repairCommand(localCommands.poll(), originalRemoteCommand.getListVersionChange() .getToVersion(), randomUUID())); final int count = localCommands.size(); for (int i = 1; i < count; i++) { localCommands.add(repairCommand(localCommands.poll(), randomUUID(), randomUUID())); } }  void repairLocalCommandsVersion(final Queue<ListCommand> localCommands,
            final ListCommand originalRemoteCommand); List<? extends ListCommand> repairRemoteCommandVersion(
            final List<? extends ListCommand> indexRepairedRemoteCommands,
            final List<ListCommand> versionRepairedLocalCommands); }
ListCommandVersionRepairer { public void repairLocalCommandsVersion(final Queue<ListCommand> localCommands, final ListCommand originalRemoteCommand) { localCommands.add(repairCommand(localCommands.poll(), originalRemoteCommand.getListVersionChange() .getToVersion(), randomUUID())); final int count = localCommands.size(); for (int i = 1; i < count; i++) { localCommands.add(repairCommand(localCommands.poll(), randomUUID(), randomUUID())); } }  void repairLocalCommandsVersion(final Queue<ListCommand> localCommands,
            final ListCommand originalRemoteCommand); List<? extends ListCommand> repairRemoteCommandVersion(
            final List<? extends ListCommand> indexRepairedRemoteCommands,
            final List<ListCommand> versionRepairedLocalCommands);  }