@Provides
  TcsClient providesTcsClient(
      @Nullable @CallbackAddress String callbackAddress,
      @Nullable @CallbackPort Integer callbackPort,
      @Nullable @CallbackPollingUri String pollingUri,
      HttpClient httpClient) {
    // when all tcs config are not set, we provide an invalid {@link TcsClient}
    // so that {@link TcsClient#isCallbackServerEnabled} returns false.
    if (callbackAddress == null && callbackPort == null && pollingUri == null) {
      return new TcsClient("", 0, "", checkNotNull(httpClient));
    }

    checkNotNull(callbackAddress);
    checkNotNull(callbackPort);
    checkNotNull(pollingUri);
    checkArgument(
        InetAddresses.isInetAddress(callbackAddress) || InternetDomainName.isValid(callbackAddress),
        "Invalid callback address specified");
    checkArgument(callbackPort > 0 && callbackPort < 65536, "Invalid port number specified");

    return new TcsClient(callbackAddress, callbackPort, pollingUri, checkNotNull(httpClient));
  }
@Test
  public void providesTcsClient_withGoodConfig_returnsValidTcsClient() {
    TcsClient client = module.providesTcsClient(DOMAIN_1, PORT_1, POLLING_URI_1, httpClient);

    assertTrue(client.isCallbackServerEnabled());
  }