@Test public void shouldDecreaseStartPositionWhenAllIndicesOfOtherRemoveFromListCommandAreBefore() { final RemoveFromList toRepair1 = new RemoveFromList(SOME_LIST, SOME_CHANGE, 10, 5); final RemoveFromList repairAgainst1 = new RemoveFromList(SOME_LIST, SOME_CHANGE, 3, 4); final List<RemoveFromList> repaired1 = cut.repairCommand(toRepair1, repairAgainst1); assertThat(repaired1).hasSize(1); positionAndCountEquals(repaired1.get(0), 6, 5); final RemoveFromList toRepair2 = new RemoveFromList(SOME_LIST, SOME_CHANGE, 3, 4); final RemoveFromList repairAgainst2 = new RemoveFromList(SOME_LIST, SOME_CHANGE, 0, 4); final List<RemoveFromList> repaired2 = cut.repairCommand(toRepair2, repairAgainst2); assertThat(repaired2).hasSize(1); positionAndCountEquals(repaired2.get(0), 0, 3); final RemoveFromList toRepair3 = new RemoveFromList(SOME_LIST, SOME_CHANGE, 20, 10); final RemoveFromList repairAgainst3 = new RemoveFromList(SOME_LIST, SOME_CHANGE, 20, 3); final List<RemoveFromList> repaired3 = cut.repairCommand(toRepair3, repairAgainst3); assertThat(repaired3).hasSize(1); positionAndCountEquals(repaired3.get(0), 20, 7); final RemoveFromList toRepair4 = new RemoveFromList(SOME_LIST, SOME_CHANGE, 10, 10); final RemoveFromList repairAgainst4 = new RemoveFromList(SOME_LIST, SOME_CHANGE, 5, 10); final List<RemoveFromList> repaired4 = cut.repairCommand(toRepair4, repairAgainst4); assertThat(repaired4).hasSize(1); positionAndCountEquals(repaired4.get(0), 5, 5); }
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);  }