@Test public void shouldSkipIndexOfAddToListCommandButRemoveSameAmountOfElements() { final RemoveFromList toRepair1 = new RemoveFromList(SOME_LIST, SOME_CHANGE, 8, 10); final AddToList repairAgainst1 = new AddToList(SOME_LIST, SOME_CHANGE, SOME_VALUE, 12); final List<RemoveFromList> repaired1 = cut.repairCommand(toRepair1, repairAgainst1); assertThat(repaired1).hasSize(2); positionAndCountEquals(repaired1.get(0), 8, 4); positionAndCountEquals(repaired1.get(1), 13, 6); 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); positionAndCountEquals(repaired2.get(0), 13, 6); final RemoveFromList toRepair3 = new RemoveFromList(SOME_LIST, SOME_CHANGE, 2, 4); final AddToList repairAgainst3 = new AddToList(SOME_LIST, SOME_CHANGE, SOME_VALUE, 5); final List<RemoveFromList> repaired3 = cut.repairCommand(toRepair3, repairAgainst3); assertThat(repaired3).hasSize(2); positionAndCountEquals(repaired3.get(0), 2, 3); positionAndCountEquals(repaired3.get(1), 6, 1); }
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);  }