### Question:
PKCS10CertificateSigningRequest { public static Builder builder() { return new Builder(); } private  PKCS10CertificateSigningRequest(Builder builder, final byte[] encoded); byte[] getEncoded(); byte[] getPem(); PublicKey getPublicKey(); X500Principal getSubjectDn(); List<X509CertificateExtension> getExtensions(); static Builder builder();  }### Answer:
@Test public void testCsrMissingCertificate() throws Exception { final PrivateKey signingKey = (PrivateKey) keyStore.getKey(KEYSTORE_ALIAS, KEYSTORE_PASSWORD); PKCS10CertificateSigningRequest.Builder builder = PKCS10CertificateSigningRequest.builder() .setSigningKey(signingKey); try { PKCS10CertificateSigningRequest csr = builder.build(); fail("Expected IllegalArgumentException not thrown"); } catch (IllegalArgumentException expected) { } }
@Test public void testCsrMissingSigningKey() throws Exception { final Certificate certificate = keyStore.getCertificate(KEYSTORE_ALIAS); PKCS10CertificateSigningRequest.Builder builder = PKCS10CertificateSigningRequest.builder() .setCertificate(certificate); try { PKCS10CertificateSigningRequest csr = builder.build(); fail("Expected IllegalArgumentException not thrown"); } catch (IllegalArgumentException expected) { } }