@Test public void dispatchesListCommandsToReparingListPropertyCommandExecutor() { final AddToList msg1 = mock(AddToList.class); final RemoveFromList msg2 = mock(RemoveFromList.class); final ReplaceInList msg3 = mock(ReplaceInList.class); final List<Command> commands = Arrays.asList(new PutToMap(), msg1, mock(SetPropertyValue.class), msg2, new Command() { }, msg3); cut.logLocalCommands(commands); verify(lists, times(3)).logLocalCommand(listCommandCaptor.capture()); assertThat(listCommandCaptor.getAllValues().get(0)).isEqualTo(msg1); assertThat(listCommandCaptor.getAllValues().get(1)).isEqualTo(msg2); assertThat(listCommandCaptor.getAllValues().get(2)).isEqualTo(msg3); }
public void logLocalCommands(final List<Command> commands) { if (singleValue == null) { return; } for (final Command command : commands) { if (command instanceof SetPropertyValue) { singleValue.logLocalCommand((SetPropertyValue) command); } else if (command instanceof ListCommand) { lists.logLocalCommand((ListCommand) command); } } }
CommandLogDispatcher { public void logLocalCommands(final List<Command> commands) { if (singleValue == null) { return; } for (final Command command : commands) { if (command instanceof SetPropertyValue) { singleValue.logLocalCommand((SetPropertyValue) command); } else if (command instanceof ListCommand) { lists.logLocalCommand((ListCommand) command); } } } }
CommandLogDispatcher { public void logLocalCommands(final List<Command> commands) { if (singleValue == null) { return; } for (final Command command : commands) { if (command instanceof SetPropertyValue) { singleValue.logLocalCommand((SetPropertyValue) command); } else if (command instanceof ListCommand) { lists.logLocalCommand((ListCommand) command); } } } CommandLogDispatcher(final RepairingSingleValuePropertyCommandExecutor singleValue,
            final ReparingListPropertyCommandExecutor lists);  CommandLogDispatcher(); }
CommandLogDispatcher { public void logLocalCommands(final List<Command> commands) { if (singleValue == null) { return; } for (final Command command : commands) { if (command instanceof SetPropertyValue) { singleValue.logLocalCommand((SetPropertyValue) command); } else if (command instanceof ListCommand) { lists.logLocalCommand((ListCommand) command); } } } CommandLogDispatcher(final RepairingSingleValuePropertyCommandExecutor singleValue,
            final ReparingListPropertyCommandExecutor lists);  CommandLogDispatcher(); void logLocalCommands(final List<Command> commands); }
CommandLogDispatcher { public void logLocalCommands(final List<Command> commands) { if (singleValue == null) { return; } for (final Command command : commands) { if (command instanceof SetPropertyValue) { singleValue.logLocalCommand((SetPropertyValue) command); } else if (command instanceof ListCommand) { lists.logLocalCommand((ListCommand) command); } } } CommandLogDispatcher(final RepairingSingleValuePropertyCommandExecutor singleValue,
            final ReparingListPropertyCommandExecutor lists);  CommandLogDispatcher(); void logLocalCommands(final List<Command> commands);  }