class ResponseAssertionsFromMatchingServiceValidator {

    public void validate(ValidatedResponse validatedResponse, ValidatedAssertions validatedAssertions) {
        if (!validatedResponse.isSuccess()) return;

        for (Assertion assertion : validatedAssertions.getAssertions()) {
            assertionValidator.validate(assertion, validatedResponse.getInResponseTo(), hubEntityId);

            if (assertion.getAuthnStatements().isEmpty()) {
                throw new SamlValidationException(missingAuthnStatement());
            }

            if (assertion.getAuthnStatements().get(0).getAuthnContext() == null) {
                throw new SamlValidationException(authnContextMissingError());
            }
        }
    }

    public  ResponseAssertionsFromMatchingServiceValidator(AssertionValidator assertionValidator, String hubEntityId);

}