### Question:
GetEmailCommand implements ExecutableCommand { @Override public void executeCommand(CommandSender sender, List<String> arguments) { String playerName = arguments.isEmpty() ? sender.getName() : arguments.get(0); DataSourceValue<String> email = dataSource.getEmail(playerName); if (email.rowExists()) { sender.sendMessage("[AuthMe] " + playerName + "'s email: " + email.getValue()); } else { commonService.send(sender, MessageKey.UNKNOWN_USER); } }  @Override void executeCommand(CommandSender sender, List<String> arguments);  }### Answer:
@Test public void shouldReportUnknownUser() { String user = "myTestUser"; given(dataSource.getEmail(user)).willReturn(DataSourceValueImpl.unknownRow()); CommandSender sender = mock(CommandSender.class); command.executeCommand(sender, Collections.singletonList(user)); verify(service).send(sender, MessageKey.UNKNOWN_USER); }
@Test public void shouldReturnEmail() { String user = "userToView"; String email = "user.email@example.org"; given(dataSource.getEmail(user)).willReturn(DataSourceValueImpl.of(email)); CommandSender sender = mock(CommandSender.class); command.executeCommand(sender, Collections.singletonList(user)); verify(sender).sendMessage(argThat(containsString(email))); }