@Test public void shouldNotChangeListIdOrVersion() { final RemoveFromList toRepair2 = new RemoveFromList(SOME_LIST, SOME_CHANGE, 12, 6); final AddToList repairAgainst2 = new AddToList(SOME_LIST, SOME_CHANGE, SOME_VALUE, 12); final List<RemoveFromList> repaired2 = cut.repairCommand(toRepair2, repairAgainst2); assertThat(repaired2).hasSize(1); assertThat(repaired2.get(0).getListId()).isEqualTo(SOME_LIST); assertThat(repaired2.get(0).getListVersionChange()).isEqualTo(SOME_CHANGE); final RemoveFromList toRepair1 = new RemoveFromList(SOME_LIST, SOME_CHANGE, 2, 4); final RemoveFromList repairAgainst1 = new RemoveFromList(SOME_LIST, SOME_CHANGE, 4, 10); final List<RemoveFromList> repaired1 = cut.repairCommand(toRepair1, repairAgainst1); assertThat(repaired1).hasSize(1); assertThat(repaired1.get(0).getListId()).isEqualTo(SOME_LIST); assertThat(repaired1.get(0).getListVersionChange()).isEqualTo(SOME_CHANGE); final RemoveFromList toRepair3 = new RemoveFromList(SOME_LIST, SOME_CHANGE, 2, 4); final ReplaceInList repairAgainst3 = new ReplaceInList(SOME_LIST, SOME_CHANGE, SOME_VALUE, 5); final List<RemoveFromList> repaired3 = cut.repairCommand(toRepair3, repairAgainst3); assertThat(repaired3).hasSize(2); assertThat(repaired3.get(0).getListId()).isEqualTo(SOME_LIST); assertThat(repaired3.get(0).getListVersionChange()).isEqualTo(SOME_CHANGE); assertThat(repaired3.get(1).getListId()).isEqualTo(SOME_LIST); assertThat(repaired3.get(1).getListVersionChange()).isEqualTo(SOME_CHANGE); }
public List<RemoveFromList> repairCommand(final RemoveFromList toRepair, final AddToList repairAgainst) { return repairAddOrReplace(toRepair, repairAgainst.getPosition()); }
RemoveFromListRepairer { public List<RemoveFromList> repairCommand(final RemoveFromList toRepair, final AddToList repairAgainst) { return repairAddOrReplace(toRepair, repairAgainst.getPosition()); } }
RemoveFromListRepairer { public List<RemoveFromList> repairCommand(final RemoveFromList toRepair, final AddToList repairAgainst) { return repairAddOrReplace(toRepair, repairAgainst.getPosition()); }  }
RemoveFromListRepairer { public List<RemoveFromList> repairCommand(final RemoveFromList toRepair, final AddToList repairAgainst) { return repairAddOrReplace(toRepair, repairAgainst.getPosition()); }  List<RemoveFromList> repairCommand(final RemoveFromList toRepair, final AddToList repairAgainst); List<RemoveFromList> repairCommand(final RemoveFromList toRepair, final RemoveFromList repairAgainst); List<RemoveFromList> repairCommand(final RemoveFromList toRepair, final ReplaceInList repairAgainst); }
RemoveFromListRepairer { public List<RemoveFromList> repairCommand(final RemoveFromList toRepair, final AddToList repairAgainst) { return repairAddOrReplace(toRepair, repairAgainst.getPosition()); }  List<RemoveFromList> repairCommand(final RemoveFromList toRepair, final AddToList repairAgainst); List<RemoveFromList> repairCommand(final RemoveFromList toRepair, final RemoveFromList repairAgainst); List<RemoveFromList> repairCommand(final RemoveFromList toRepair, final ReplaceInList repairAgainst);  }