code: public void setTrustAnchors(Set<TrustAnchor> trustAnchors)
          throws InvalidAlgorithmParameterException
      {
          if (trustAnchors == null) {
              throw new NullPointerException("the trustAnchors parameters must" +
                  " be non-null");
          }
          if (trustAnchors.isEmpty()) {
              throw new InvalidAlgorithmParameterException("the trustAnchors " +
                  "parameter must be non-empty");
          }
          for (Iterator<TrustAnchor> i = trustAnchors.iterator(); i.hasNext(); ) {
              if (!(i.next() instanceof TrustAnchor)) {
                  throw new ClassCastException("all elements of set must be "
                      + "of type java.security.cert.TrustAnchor");
              }
          }
          this.unmodTrustAnchors = Collections.unmodifiableSet
                  (new HashSet<TrustAnchor>(trustAnchors));
      }
docs: Sets the {@code Set} of most-trusted CAs.
  <p>
  Note that the {@code Set} is copied to protect against
  subsequent modifications.
  
  @param trustAnchors a {@code Set} of {@code TrustAnchor}s
  @throws InvalidAlgorithmParameterException if the specified
  {@code Set} is empty {@code (trustAnchors.isEmpty() == true)}
  @throws NullPointerException if the specified {@code Set} is
  {@code null}
  @throws ClassCastException if any of the elements in the set
  are not of type {@code java.security.cert.TrustAnchor}
  
  @see #getTrustAnchors