@Test public void shouldNotChangeIndexOfRemoteAddToListIfIndexIsSameAsLocalAddToListIndex() { final AddToList toRepair1 = new AddToList(SOME_LIST, SOME_CHANGE, SOME_VALUE, 53); final AddToList repairAgainst1 = new AddToList(SOME_LIST, SOME_CHANGE, SOME_VALUE, 53); final AddToList repaired1 = cut.repairRemoteCommand(toRepair1, repairAgainst1); assertThat(repaired1.getPosition()).isEqualTo(54); }
public AddToList repairRemoteCommand(final AddToList toRepair, final AddToList repairAgainst) { if (toRepair.getPosition() >= repairAgainst.getPosition()) { return createCommand(toRepair, toRepair.getPosition() + 1); } return toRepair; }
AddToListRepairer { public AddToList repairRemoteCommand(final AddToList toRepair, final AddToList repairAgainst) { if (toRepair.getPosition() >= repairAgainst.getPosition()) { return createCommand(toRepair, toRepair.getPosition() + 1); } return toRepair; } }
AddToListRepairer { public AddToList repairRemoteCommand(final AddToList toRepair, final AddToList repairAgainst) { if (toRepair.getPosition() >= repairAgainst.getPosition()) { return createCommand(toRepair, toRepair.getPosition() + 1); } return toRepair; }  }
AddToListRepairer { public AddToList repairRemoteCommand(final AddToList toRepair, final AddToList repairAgainst) { if (toRepair.getPosition() >= repairAgainst.getPosition()) { return createCommand(toRepair, toRepair.getPosition() + 1); } return toRepair; }  AddToList repairLocalCommand(final AddToList toRepair, final AddToList repairAgainst); AddToList repairRemoteCommand(final AddToList toRepair, final AddToList repairAgainst); AddToList repairCommand(final AddToList toRepair, final RemoveFromList repairAgainst); AddToList repairCommand(final AddToList toRepair, final ReplaceInList repairAgainst); }
AddToListRepairer { public AddToList repairRemoteCommand(final AddToList toRepair, final AddToList repairAgainst) { if (toRepair.getPosition() >= repairAgainst.getPosition()) { return createCommand(toRepair, toRepair.getPosition() + 1); } return toRepair; }  AddToList repairLocalCommand(final AddToList toRepair, final AddToList repairAgainst); AddToList repairRemoteCommand(final AddToList toRepair, final AddToList repairAgainst); AddToList repairCommand(final AddToList toRepair, final RemoveFromList repairAgainst); AddToList repairCommand(final AddToList toRepair, final ReplaceInList repairAgainst);  }