### Question:
SwitchAntiBotCommand implements ExecutableCommand { @Override public void executeCommand(final CommandSender sender, List<String> arguments) { if (arguments.isEmpty()) { sender.sendMessage("[AuthMe] AntiBot status: " + antiBotService.getAntiBotStatus().name()); return; } String newState = arguments.get(0); if ("ON".equalsIgnoreCase(newState)) { antiBotService.overrideAntiBotStatus(true); sender.sendMessage("[AuthMe] AntiBot Manual Override: enabled!"); } else if ("OFF".equalsIgnoreCase(newState)) { antiBotService.overrideAntiBotStatus(false); sender.sendMessage("[AuthMe] AntiBot Manual Override: disabled!"); } else { sender.sendMessage(ChatColor.DARK_RED + "Invalid AntiBot mode!"); FoundCommandResult result = commandMapper.mapPartsToCommand(sender, Arrays.asList("authme", "antibot")); helpProvider.outputHelp(sender, result, HelpProvider.SHOW_ARGUMENTS); sender.sendMessage(ChatColor.GOLD + "Detailed help: " + ChatColor.WHITE + "/authme help antibot"); } }  @Override void executeCommand(final CommandSender sender, List<String> arguments);  }### Answer:
@Test public void shouldReturnAntiBotState() { given(antiBot.getAntiBotStatus()).willReturn(AntiBotService.AntiBotStatus.ACTIVE); CommandSender sender = mock(CommandSender.class); command.executeCommand(sender, Collections.emptyList()); verify(sender).sendMessage(argThat(containsString("status: ACTIVE"))); }
@Test public void shouldActivateAntiBot() { CommandSender sender = mock(CommandSender.class); command.executeCommand(sender, Collections.singletonList("on")); verify(antiBot).overrideAntiBotStatus(true); verify(sender).sendMessage(argThat(containsString("enabled"))); }
@Test public void shouldDeactivateAntiBot() { CommandSender sender = mock(CommandSender.class); command.executeCommand(sender, Collections.singletonList("Off")); verify(antiBot).overrideAntiBotStatus(false); verify(sender).sendMessage(argThat(containsString("disabled"))); }
@Test public void shouldShowHelpForUnknownState() { CommandSender sender = mock(CommandSender.class); FoundCommandResult foundCommandResult = mock(FoundCommandResult.class); given(commandMapper.mapPartsToCommand(sender, asList("authme", "antibot"))).willReturn(foundCommandResult); command.executeCommand(sender, Collections.singletonList("wrong")); verify(antiBot, never()).overrideAntiBotStatus(anyBoolean()); verify(sender).sendMessage(argThat(containsString("Invalid"))); verify(helpProvider).outputHelp(sender, foundCommandResult, HelpProvider.SHOW_ARGUMENTS); }