@Test public void shouldExecuteRemoveFromListCommands() { exemplaryList.addAll("first", "second", "third", "forth", "fifth"); final RemoveFromList command1 = new RemoveFromList(exemplaryListId, exemplaryVersionChange, 1, 2); final RemoveFromList command2 = new RemoveFromList(exemplaryListId, exemplaryVersionChange, 2, 1); cut.execute(command1); cut.execute(command2); assertThat(exemplaryList.get()).containsExactly("first", "forth"); }
@Override public void execute(final AddToList command) { final List<Object> list = getListOrFail(command); final Object value = valueMapper.map(command.getValue()); silentChangeExecutor.execute(list, new Runnable() { @Override public void run() { list.add(command.getPosition(), value); } }); updateVersion(command); }
SimpleListPropertyCommandExecutor implements ListPropertyCommandExecutor { @Override public void execute(final AddToList command) { final List<Object> list = getListOrFail(command); final Object value = valueMapper.map(command.getValue()); silentChangeExecutor.execute(list, new Runnable() { @Override public void run() { list.add(command.getPosition(), value); } }); updateVersion(command); } }
SimpleListPropertyCommandExecutor implements ListPropertyCommandExecutor { @Override public void execute(final AddToList command) { final List<Object> list = getListOrFail(command); final Object value = valueMapper.map(command.getValue()); silentChangeExecutor.execute(list, new Runnable() { @Override public void run() { list.add(command.getPosition(), value); } }); updateVersion(command); } SimpleListPropertyCommandExecutor(final WeakObjectRegistry objectRegistry,
            final SilentChangeExecutor silentChangeExecutor, final ValueMapper valueMapper,
            final ListPropertyMetaDataStore listVersions); }
SimpleListPropertyCommandExecutor implements ListPropertyCommandExecutor { @Override public void execute(final AddToList command) { final List<Object> list = getListOrFail(command); final Object value = valueMapper.map(command.getValue()); silentChangeExecutor.execute(list, new Runnable() { @Override public void run() { list.add(command.getPosition(), value); } }); updateVersion(command); } SimpleListPropertyCommandExecutor(final WeakObjectRegistry objectRegistry,
            final SilentChangeExecutor silentChangeExecutor, final ValueMapper valueMapper,
            final ListPropertyMetaDataStore listVersions); @Override void execute(final AddToList command); @Override void execute(final RemoveFromList command); @Override void execute(final ReplaceInList command); }
SimpleListPropertyCommandExecutor implements ListPropertyCommandExecutor { @Override public void execute(final AddToList command) { final List<Object> list = getListOrFail(command); final Object value = valueMapper.map(command.getValue()); silentChangeExecutor.execute(list, new Runnable() { @Override public void run() { list.add(command.getPosition(), value); } }); updateVersion(command); } SimpleListPropertyCommandExecutor(final WeakObjectRegistry objectRegistry,
            final SilentChangeExecutor silentChangeExecutor, final ValueMapper valueMapper,
            final ListPropertyMetaDataStore listVersions); @Override void execute(final AddToList command); @Override void execute(final RemoveFromList command); @Override void execute(final ReplaceInList command);  }