class QueryResponseValidator implements Validator<EbXMLQueryResponse, ValidationProfile> {

    @Override
    public void validate(EbXMLQueryResponse response, ValidationProfile profile) {
        notNull(response, "response cannot be null");
        
        regResponseValidator.validate(response, profile);
        objectContainerValidator.validate(response, profile);

        List<ObjectReference> references = response.getReferences();
        for (ObjectReference objRef : references) {
            metaDataAssert(objRef.getId() != null, MISSING_OBJ_REF);
        }

        validatePatientIdsAreIdentical(response);
    }

}