### Question:
HttpClient implements IHttpClient { public boolean check(String url) { Transaction transaction = Tracer.newTransaction("mq-http-doubleCheck", url); Response response = null; try { Request request = new Request.Builder().url(url).get().build(); response = client.newCall(request).execute(); transaction.setStatus(Transaction.SUCCESS); return response.isSuccessful(); } catch (Exception e) { transaction.setStatus(e); return false; } finally { transaction.complete(); try { if (response != null) { response.close(); } } catch (Exception e) { } } } HttpClient(long connTimeout, long readTimeout);  HttpClient(); boolean check(String url); String post(String url, Object reqObj); T post(String url, Object request, Class<T> class1); T get(String url, Class<T> class1); void postAsyn(String url, Object reqObj, Callback callback); String get(String url);  }### Answer:
@Test public void checkTest() throws IOException { ClientAndServer mockClient = new ClientAndServer(5000); try { mockClient.when(HttpRequest.request().withMethod("GET")) .respond(HttpResponse.response().withStatusCode(200)); HttpClient httpClient = new HttpClient(); assertEquals(true, httpClient.check("http: } finally { mockClient.stop(true); } }
@Test public void checkFalseTest() throws IOException { HttpClient httpClient = new HttpClient(10, 10); assertEquals(false, httpClient.check("http: }