### Question:
PSD2QCStatement { public static PSD2QCType psd2QCType(X509Certificate cert) throws CertificateValidationException { byte[] extValues = cert.getExtensionValue(Extension.qCStatements.getId()); if (extValues == null) { log.debug("QCStatement not found in psd2 certificate. Missing extension with value {}", Extension.qCStatements.getId()); throw new CertificateValidationException(CertificateErrorMsgCode.CERTIFICATE_INVALID.toString()); } QCStatement qcStatement = readQCStatement(extValues); ASN1Encodable statementInfo = qcStatement.getStatementInfo(); return PSD2QCType.getInstance(statementInfo); } private  PSD2QCStatement(); static QCStatement psd2QCStatement(); static PSD2QCType psd2QCType(X509Certificate cert);  }### Answer:
@Test void psd2QCType_success() throws CertificateValidationException { PSD2QCType psd2QCType = PSD2QCStatement.psd2QCType(validCertificate); assertNotNull(psd2QCType); }
@Test void psd2QCType_QCStatementNotFound() { assertThrows(CertificateValidationException.class, () -> PSD2QCStatement.psd2QCType(invalidCertificate)); }