@Test void createPKIXParameters_test_with_empty_trustAnchors() { HashSet<TrustAnchor> trustAnchors = new HashSet<>(); Throwable t = assertThrows(IllegalArgumentException.class, () -> CertificateUtil.createPKIXParameters(trustAnchors) ); assertThat(t).hasMessage("trustAnchors is required; it must not be empty"); }
public static PKIXParameters createPKIXParameters(Set<TrustAnchor> trustAnchors) { AssertUtil.notEmpty(trustAnchors, "trustAnchors is required; it must not be empty"); try { return new PKIXParameters(trustAnchors); } catch (InvalidAlgorithmParameterException e) { throw new UnexpectedCheckedException(e); } }
CertificateUtil { public static PKIXParameters createPKIXParameters(Set<TrustAnchor> trustAnchors) { AssertUtil.notEmpty(trustAnchors, "trustAnchors is required; it must not be empty"); try { return new PKIXParameters(trustAnchors); } catch (InvalidAlgorithmParameterException e) { throw new UnexpectedCheckedException(e); } } }
CertificateUtil { public static PKIXParameters createPKIXParameters(Set<TrustAnchor> trustAnchors) { AssertUtil.notEmpty(trustAnchors, "trustAnchors is required; it must not be empty"); try { return new PKIXParameters(trustAnchors); } catch (InvalidAlgorithmParameterException e) { throw new UnexpectedCheckedException(e); } } private  CertificateUtil(); }
CertificateUtil { public static PKIXParameters createPKIXParameters(Set<TrustAnchor> trustAnchors) { AssertUtil.notEmpty(trustAnchors, "trustAnchors is required; it must not be empty"); try { return new PKIXParameters(trustAnchors); } catch (InvalidAlgorithmParameterException e) { throw new UnexpectedCheckedException(e); } } private  CertificateUtil(); static CertPathValidator createCertPathValidator(); static PKIXParameters createPKIXParameters(Set<TrustAnchor> trustAnchors); static KeyStore createKeyStore(); static Set<TrustAnchor> generateTrustAnchors(List<C> certificates); static CertPath generateCertPath(List<C> certificates); static X509Certificate generateX509Certificate(byte[] bytes); static X509Certificate generateX509Certificate(InputStream inputStream); }
CertificateUtil { public static PKIXParameters createPKIXParameters(Set<TrustAnchor> trustAnchors) { AssertUtil.notEmpty(trustAnchors, "trustAnchors is required; it must not be empty"); try { return new PKIXParameters(trustAnchors); } catch (InvalidAlgorithmParameterException e) { throw new UnexpectedCheckedException(e); } } private  CertificateUtil(); static CertPathValidator createCertPathValidator(); static PKIXParameters createPKIXParameters(Set<TrustAnchor> trustAnchors); static KeyStore createKeyStore(); static Set<TrustAnchor> generateTrustAnchors(List<C> certificates); static CertPath generateCertPath(List<C> certificates); static X509Certificate generateX509Certificate(byte[] bytes); static X509Certificate generateX509Certificate(InputStream inputStream);  }