public static ClientRequestContextCaptor newContextCaptor() {
        return ClientThreadLocalState.maybeCreate().newContextCaptor();
    }
Prepare to capture the {@link ClientRequestContext} of the next request sent from the current thread.
Use the {@code try-with-resources} block with the returned {@link ClientRequestContextCaptor}
to retrieve the captured {@link ClientRequestContext} and to unset the thread-local variable
automatically.
<pre>{@code
try (ClientRequestContextCaptor captor = Clients.newContextCaptor()) {
    WebClient.of().get("https://www.example.com/hello");
    ClientRequestContext ctx = captor.get();
    assert ctx.path().equals("/hello");
}}</pre>
Note that you can also capture more than one {@link ClientRequestContext}:
<pre>{@code
try (ClientRequestContextCaptor captor = Clients.newContextCaptor()) {
    WebClient.of().get("https://www.example.com/foo");
    WebClient.of().get("https://www.example.com/bar");
    List<ClientRequestContext> contexts = captor.getAll();
    assert contexts.get(0).path().equals("/foo");
    assert contexts.get(1).path().equals("/bar");
}}</pre>
core/src/main/java/com/linecorp/armeria/client/Clients.java