public TrustAnchor findBySubjectAndPublicKey(X509Certificate cert) {
        X500Principal subject = cert.getSubjectX500Principal();
        synchronized (subjectToTrustAnchors) {
            List<TrustAnchor> anchors = subjectToTrustAnchors.get(subject);
            if (anchors == null) {
                return null;
            }
            return findBySubjectAndPublicKey(cert, anchors);
        }
    }
Indexes {@code TrustAnchor} instances so they can be found in O(1)
time instead of O(N).
common/src/main/java/org/conscrypt/TrustedCertificateIndex.java