@Test public void shouldExecuteAddToListCommands() { final AddToList command1 = new AddToList(exemplaryListId, exemplaryVersionChange, new Value("second"), 0); final AddToList command2 = new AddToList(exemplaryListId, exemplaryVersionChange, new Value("first"), 0); final AddToList command3 = new AddToList(exemplaryListId, exemplaryVersionChange, new Value("third"), 2); cut.execute(command1); cut.execute(command2); cut.execute(command3); assertThat(exemplaryList.get()).containsExactly("first", "second", "third"); }
@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);  }