code: void trySetTrustAnchor(TrustAnchor anchor) {
          // Don't bother if the check has started or trust anchor has already
          // specified.
          if (prevPubKey == null) {
              if (anchor == null) {
                  throw new IllegalArgumentException(
                          "The trust anchor cannot be null");
              }
  
              // Don't bother to change the trustedPubKey.
              if (anchor.getTrustedCert() != null) {
                  prevPubKey = anchor.getTrustedCert().getPublicKey();
              } else {
                  prevPubKey = anchor.getCAPublicKey();
              }
          }
      }
docs: Try to set the trust anchor of the checker.
  <p>
  If there is no trust anchor specified and the checker has not started,
  set the trust anchor.
  
  @param anchor the trust anchor selected to validate the target
  certificate