CertificateValidator implements ProcessExecutorProvider<CertificateProcessExecutor> { public static CertificateValidator fromCertificate(final CertificateToken token) { return new CertificateValidator(token); } private  CertificateValidator(CertificateToken token); static CertificateValidator fromCertificate(final CertificateToken token); void setCertificateVerifier(CertificateVerifier certificateVerifier); void setTokenExtractionStategy(TokenExtractionStategy tokenExtractionStategy); void setValidationTime(Date validationTime); void setLocale(Locale locale); CertificateReports validate(); CertificateReports validate(ValidationPolicy validationPolicy); @Override void setProcessExecutor(CertificateProcessExecutor processExecutor); CertificateProcessExecutor provideProcessExecutorInstance(); @Override CertificateProcessExecutor getDefaultProcessExecutor();  }
@Test public void testCertNull() { NullPointerException exception = assertThrows(NullPointerException.class, () -> CertificateValidator.fromCertificate(null)); assertEquals("The certificate is missing", exception.getMessage()); }