@Test public void shouldIncreaseIndexOfLocalAddToListCommandIfIndexIsSameAsRemoteAddToListIndex() { 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.repairLocalCommand(toRepair1, repairAgainst1); assertThat(repaired1.getPosition()).isEqualTo(54); }
public AddToList repairLocalCommand(final AddToList toRepair, final AddToList repairAgainst) { if (toRepair.getPosition() == repairAgainst.getPosition()) { return createCommand(toRepair, toRepair.getPosition() + 1); } return repairRemoteCommand(toRepair, repairAgainst); }
AddToListRepairer { public AddToList repairLocalCommand(final AddToList toRepair, final AddToList repairAgainst) { if (toRepair.getPosition() == repairAgainst.getPosition()) { return createCommand(toRepair, toRepair.getPosition() + 1); } return repairRemoteCommand(toRepair, repairAgainst); } }
AddToListRepairer { public AddToList repairLocalCommand(final AddToList toRepair, final AddToList repairAgainst) { if (toRepair.getPosition() == repairAgainst.getPosition()) { return createCommand(toRepair, toRepair.getPosition() + 1); } return repairRemoteCommand(toRepair, repairAgainst); }  }
AddToListRepairer { public AddToList repairLocalCommand(final AddToList toRepair, final AddToList repairAgainst) { if (toRepair.getPosition() == repairAgainst.getPosition()) { return createCommand(toRepair, toRepair.getPosition() + 1); } return repairRemoteCommand(toRepair, repairAgainst); }  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 repairLocalCommand(final AddToList toRepair, final AddToList repairAgainst) { if (toRepair.getPosition() == repairAgainst.getPosition()) { return createCommand(toRepair, toRepair.getPosition() + 1); } return repairRemoteCommand(toRepair, repairAgainst); }  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);  }