public Builder setTrustAnchors(Set<TrustAnchor> trustAnchors) { if (trustAnchors == null) throw new NullPointerException( "the trustAnchors parameters must" + " be non-null"); 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"); } baseBuilder.setTrustAnchors(trustAnchors); return this; }