public final static String checkToString(final RouteTracker rt) {
        if (rt == null) {
            return null;
        }

        final String rts = rt.toString();

        if (rt.getLocalAddress() != null) {
            final String las = rt.getLocalAddress().toString();
            Assertions.assertTrue(rts.contains(las), "no local address in toString(): " + rts);
        }

        for (int i = 0; i < rt.getHopCount(); i++) {
            final String hts = rt.getHopTarget(i).toString();
            Assertions.assertTrue(rts.contains(hts), "hop " + i + " (" + hts + ") missing in toString(): " + rts);
        }

        return rts;
    }
Checks the output of {@code toString}.

@param rt        the tracker for which to check the output

@return  the result of {@code rt.toString()}
httpclient5/src/test/java/org/apache/hc/client5/http/impl/routing/TestRouteTracker.java