@Override
  public void execute(final List<String> args, final PrintWriter terminal) {
    CliCmdUtil.ensureArgCountBounds(args, 0, 1, HELP);

    if (args.isEmpty()) {
      terminal.println(restClient.getServerAddress());
      return;
    } else {
      final String serverAddress = args.get(0);
      restClient.setServerAddress(serverAddress);
      terminal.println("Server now: " + serverAddress);
      resetCliForNewServer.fire();
    }

    validateClient(terminal, restClient);
  }
@Test
  public void shouldSetRestClientServerAddressWhenNonEmptyStringArg() {
    // When:
    command.execute(ImmutableList.of(VALID_SERVER_ADDRESS), terminal);

    // Then:
    verify(restClient).setServerAddress(VALID_SERVER_ADDRESS);
  }