### Question:
DatadogHttpClient { Proxy getProxy() { if (proxyHost == null) { return Proxy.NO_PROXY; } else { return new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyHost, proxyPort)); } } DatadogHttpClient(String dgApiKey, String dgProxyHost, int dgProxyPort); void send(DatadogHttpReporter.DatadogHttpRequest request); static String serialize(Object obj); void close();  }### Answer:
@Test public void testGetProxyWithNullProxyHost() { DatadogHttpClient client = new DatadogHttpClient("anApiKey", null, 123); assert(client.getProxy() == Proxy.NO_PROXY); }
@Test public void testGetProxy() { DatadogHttpClient client = new DatadogHttpClient("anApiKey", "localhost", 123); assertTrue(client.getProxy().address() instanceof InetSocketAddress); InetSocketAddress proxyAddress = (InetSocketAddress) client.getProxy().address(); assertEquals(123, proxyAddress.getPort()); assertEquals("localhost", proxyAddress.getHostString()); }