@Override
  public HttpResponse send(HttpRequest httpRequest) throws IOException {
    return send(httpRequest, null);
  }
@Test
  public void send_whenHostnameAndIpInRequest_useHostnameAsProxy() throws IOException {
    InetAddress loopbackAddress = InetAddress.getLoopbackAddress();
    String host = "host.com";
    mockWebServer.setDispatcher(new HostnameTestDispatcher(host));
    mockWebServer.start(loopbackAddress, 0);
    int port = mockWebServer.url("/").port();

    NetworkService networkService =
        NetworkService.newBuilder()
            .setNetworkEndpoint(
                NetworkEndpointUtils.forIpHostnameAndPort(
                    loopbackAddress.getHostAddress(), host, port))
            .build();

    // The request to host.com should be sent through mockWebServer's IP.
    HttpResponse response =
        httpClient.send(
            get(String.format("http://host.com:%d/test/get", port)).withEmptyHeaders().build(),
            networkService);

    assertThat(response.status()).isEqualTo(HttpStatus.OK);
  }