### Question:
SelfSignedX509CertificateAndSigningKey { public static Builder builder() { return new Builder(); } private  SelfSignedX509CertificateAndSigningKey(Builder builder); X509Certificate getSelfSignedCertificate(); PrivateKey getSigningKey(); PKCS10CertificateSigningRequest generatePKCS10CertificateSigningRequest(); static Builder builder();  }### Answer:
@Test public void testSelfSignedCertificateMissingDn() throws Exception { SelfSignedX509CertificateAndSigningKey.Builder builder = SelfSignedX509CertificateAndSigningKey.builder(); try { builder.build(); fail("Expected IllegalArgumentException not thrown"); } catch (IllegalArgumentException expected) { } }
@Test public void testSelfSignedCertificateWithIncompatibleSignatureAlgorithm() throws Exception { SelfSignedX509CertificateAndSigningKey.Builder builder = SelfSignedX509CertificateAndSigningKey.builder() .setDn(DN) .setKeyAlgorithmName("RSA") .setSignatureAlgorithmName("SHA1withDSA"); try { builder.build(); fail("Expected IllegalArgumentException not thrown"); } catch (IllegalArgumentException expected) { } }