### Question:
ConfigValidationException extends RuntimeException { public static ConfigValidationException createInvalidCertificatesException(List<InvalidCertificateDto> invalidCertificates) { return new ConfigValidationException(invalidCertificates.stream().map(certificate -> MessageFormat.format( "Invalid certificate found.\nEntity Id: {0}\nCertificate Type: {1}\nFederation Type: {2}\nReason: {3}\nDescription: {4}", certificate.getEntityId(), certificate.getCertificateType(), certificate.getFederationType(), certificate.getReason(), certificate.getDescription())).collect(Collectors.joining("\n"))); } private  ConfigValidationException(String message); static ConfigValidationException createFileReadError(String filePath); static ConfigValidationException createDuplicateEntityIdException(String entityId); static ConfigValidationException createMissingMatchingEntityIdException(String transactionEntityId); static ConfigValidationException createAbsentMatchingServiceConfigException(String matchingServiceEntityId, String transactionEntityId); static ConfigValidationException createAbsentOnboardingTransactionConfigException(String transactionEntityId, String idpEntityId); static ConfigValidationException createInvalidCertificatesException(List<InvalidCertificateDto> invalidCertificates); static ConfigValidationException createIDPLevelsOfAssuranceUnsupportedException(Collection<IdentityProviderConfig> badIDPConfigs); static ConfigValidationException createTransactionsRequireUnsupportedLevelOfAssurance(Collection<TransactionConfig> badTransactionConfigs); static ConfigValidationException createIncompatiblePairsOfTransactionsAndIDPs(Map<TransactionConfig, List<IdentityProviderConfig>> incompatibleIdps);  }### Answer:
@Test public void createInvalidCertificatesException() throws Exception { InvalidCertificateDto invalidCertificateDto = new InvalidCertificateDto("entity-id", CertPathValidatorException.BasicReason.EXPIRED, CertificateUse.ENCRYPTION, FederationEntityType.IDP, "description"); ConfigValidationException exception = ConfigValidationException.createInvalidCertificatesException(singletonList(invalidCertificateDto)); assertThat(exception.getMessage()).isEqualTo("Invalid certificate found.\n" + "Entity Id: entity-id\n" + "Certificate Type: ENCRYPTION\n" + "Federation Type: IDP\n" + "Reason: EXPIRED\n" + "Description: description"); }