### Question:
OpenSslCertificateException extends CertificateException { public int errorCode() { return errorCode; } OpenSslCertificateException(int errorCode);  OpenSslCertificateException(String msg, int errorCode);  OpenSslCertificateException(String message, Throwable cause, int errorCode);  OpenSslCertificateException(Throwable cause, int errorCode); int errorCode();  }### Answer:
@Test public void testValidErrorCode() throws Exception { Assume.assumeTrue(OpenSsl.isAvailable()); Field[] fields = CertificateVerifier.class.getFields(); for (Field field : fields) { if (field.isAccessible()) { int errorCode = field.getInt(null); OpenSslCertificateException exception = new OpenSslCertificateException(errorCode); Assert.assertEquals(errorCode, exception.errorCode()); } } }