public static HttpAsyncClientBuilder custom(MetricRegistry metricRegistry) {
        return custom(metricRegistry, METHOD_ONLY);
    }
@Test
    public void registersExpectedMetricsGivenNameStrategy() throws Exception {
        client = InstrumentedHttpAsyncClients.custom(metricRegistry, metricNameStrategy).disableAutomaticRetries().build();
        client.start();

        final SimpleHttpRequest request = SimpleRequestBuilder
                .get("http://localhost:" + httpServer.getAddress().getPort() + "/")
                .build();
        final String metricName = "some.made.up.metric.name";

        httpServer.createContext("/", exchange -> {
            exchange.sendResponseHeaders(200, 0L);
            exchange.setStreams(null, null);
            exchange.getResponseBody().write("TEST".getBytes(StandardCharsets.US_ASCII));
            exchange.close();
        });
        httpServer.start();

        when(metricNameStrategy.getNameFor(any(), any(HttpRequest.class))).thenReturn(metricName);

        final Future<SimpleHttpResponse> responseFuture = client.execute(request, new FutureCallback<SimpleHttpResponse>() {
            @Override
            public void completed(SimpleHttpResponse result) {
                assertThat(result.getBodyText()).isEqualTo("TEST");
            }

            @Override
            public void failed(Exception ex) {
                fail();
            }

            @Override
            public void cancelled() {
                fail();
            }
        });
        responseFuture.get(1L, TimeUnit.SECONDS);

        verify(registryListener).onTimerAdded(eq(metricName), any(Timer.class));
    }