@Override
    public int getHopCount() {
        int hops = 0;
        if (this.connected) {
            if (proxyChain == null) {
                hops = 1;
            } else {
                hops = proxyChain.length + 1;
            }
        }
        return hops;
    }
Tracks layering a protocol.

@param secure    {@code true} if the route is secure,
                 {@code false} otherwise
httpclient5/src/main/java/org/apache/hc/client5/http/RouteTracker.java