Proxy getProxy() {
        if (proxyHost == null) {
            return Proxy.NO_PROXY;
        } else {
            return new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyHost, proxyPort));
        }
    }
@Test
    void testGetProxy() {
        DatadogHttpClient client =
                new DatadogHttpClient("anApiKey", "localhost", 123, DataCenter.US, false);

        assertThat(client.getProxy().address()).isInstanceOf(InetSocketAddress.class);

        InetSocketAddress proxyAddress = (InetSocketAddress) client.getProxy().address();

        assertThat(proxyAddress.getPort()).isEqualTo(123);
        assertThat(proxyAddress.getHostString()).isEqualTo("localhost");
    }