static <T, C> LoadBalancer<T, C> ofSticky(Iterable<? extends T> candidates,
                                              ToLongFunction<? super C> contextHasher) {
        requireNonNull(candidates, "candidates");
        requireNonNull(contextHasher, "contextHasher");
        return new StickyLoadBalancer<>(candidates, contextHasher);
    }
Returns a {@link LoadBalancer} that selects a candidate using the sticky strategy.
The {@link ToLongFunction} is used to compute hashes for consistent hashing.

<p>This strategy can be useful when all requests that qualify some given criteria must be sent to
the same backend server. A common use case is to send all requests for the same logged-in user to
the same backend, which could have a local cache keyed by user id.

<p>In below example, created strategy will route all {@link HttpRequest} which have the same value for
key "cookie" of its header to the same server:

<pre>{@code
ToLongFunction<ClientRequestContext> hasher = (ClientRequestContext ctx) -> {
    return ((HttpRequest) ctx.request()).headers().get(HttpHeaderNames.COOKIE).hashCode();
};
LoadBalancer<Endpoint, ClientRequestContext> strategy = LoadBalancer.ofSticky(endpoints, hasher);
}</pre>
core/src/main/java/com/linecorp/armeria/common/loadbalancer/LoadBalancer.java