### Question:
AddDockedNodeCommand extends AbstractGraphCompositeCommand { protected AddDockedNodeCommand initialize(final GraphCommandExecutionContext context) { super.initialize(context); this.addCommand(new RegisterNodeCommand(candidate)) .addCommand(new DockNodeCommand(getParent(context), candidate)); return this; } AddDockedNodeCommand(final @MapsTo("parentUUID") String parentUUID,
                                final @MapsTo("candidate") Node candidate);  AddDockedNodeCommand(final Node parent,
                                final Node candidate); @Override @SuppressWarnings("unchecked") CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context); Node getCandidate(); @Override String toString();  }### Answer:
@Test @SuppressWarnings("unchecked") public void testInitializeCommands() { this.tested = spy(tested); tested.initialize(graphCommandExecutionContext); ArgumentCaptor<Command> commandArgumentCaptor = ArgumentCaptor.forClass(Command.class); verify(tested, times(2)).addCommand(commandArgumentCaptor.capture()); List<Command> commands = commandArgumentCaptor.getAllValues(); assertNotNull(commands); assertTrue(commands.size() == 2); assertTrue(commands.get(0) instanceof RegisterNodeCommand); assertTrue(commands.get(1) instanceof DockNodeCommand); }