code: private void buildIndex(Collection<?> coll) {
          certSubjects = new HashMap<X500Principal, Object>();
          crlIssuers = new HashMap<X500Principal, Object>();
          otherCertificates = null;
          otherCRLs = null;
          for (Object obj : coll) {
              if (obj instanceof X509Certificate) {
                  indexCertificate((X509Certificate)obj);
              } else if (obj instanceof X509CRL) {
                  indexCRL((X509CRL)obj);
              } else if (obj instanceof Certificate) {
                  if (otherCertificates == null) {
                      otherCertificates = new HashSet<Certificate>();
                  }
                  otherCertificates.add((Certificate)obj);
              } else if (obj instanceof CRL) {
                  if (otherCRLs == null) {
                      otherCRLs = new HashSet<CRL>();
                  }
                  otherCRLs.add((CRL)obj);
              } else {
                  // ignore
              }
          }
          if (otherCertificates == null) {
              otherCertificates = Collections.<Certificate>emptySet();
          }
          if (otherCRLs == null) {
              otherCRLs = Collections.<CRL>emptySet();
          }
      }
docs: Index the specified Collection copying all references to Certificates
  and CRLs.