@Override
        public int compare(TrustAnchor lhs, TrustAnchor rhs) {
            X509Certificate lhsCert = lhs.getTrustedCert();
            X509Certificate rhsCert = rhs.getTrustedCert();
            return CERT_COMPARATOR.compare(lhsCert, rhsCert);
        }
Comparator for sorting {@link TrustAnchor}s using a {@link CertificatePriorityComparator}.
common/src/main/java/org/conscrypt/TrustManagerImpl.java