### Question:
ChangePasswordAdminCommand implements ExecutableCommand { @Override public void executeCommand(CommandSender sender, List<String> arguments) { final String playerName = arguments.get(0); final String playerPass = arguments.get(1); ValidationResult validationResult = validationService.validatePassword(playerPass, playerName); if (validationResult.hasError()) { commonService.send(sender, validationResult.getMessageKey(), validationResult.getArgs()); } else { management.performPasswordChangeAsAdmin(sender, playerName, playerPass); } }  @Override void executeCommand(CommandSender sender, List<String> arguments);  }### Answer:
@Test public void shouldForwardRequestToManagement() { String name = "theUser"; String pass = "newPassword"; given(validationService.validatePassword(pass, name)).willReturn(new ValidationResult()); CommandSender sender = mock(CommandSender.class); command.executeCommand(sender, Arrays.asList(name, pass)); verify(validationService).validatePassword(pass, name); verify(management).performPasswordChangeAsAdmin(sender, name, pass); }
@Test public void shouldSendErrorToCommandSender() { String name = "theUser"; String pass = "newPassword"; given(validationService.validatePassword(pass, name)).willReturn( new ValidationResult(MessageKey.INVALID_PASSWORD_LENGTH, "7")); CommandSender sender = mock(CommandSender.class); command.executeCommand(sender, Arrays.asList(name, pass)); verify(validationService).validatePassword(pass, name); verify(commonService).send(sender, MessageKey.INVALID_PASSWORD_LENGTH, "7"); verifyZeroInteractions(management); }