class NotifyValidationHandler {

    private final List<NotifierProvider> notifierProviders;
    private final List<TemplateProvider> templateProviders;

    @EventListener
    public void handleConfigEvent(EntityCreatedEvent<NotifyConfigEntity> event){
        event.async(
            Flux.fromIterable(event.getEntity())
                .flatMap(this::validateConfig)
        );
    }

    @EventListener
    public void handleConfigEvent(EntitySavedEvent<NotifyConfigEntity> event){
        event.async(
            Flux.fromIterable(event.getEntity())
                .flatMap(this::validateConfig)
        );
    }

    @EventListener
    public void handleConfigEvent(EntityModifyEvent<NotifyConfigEntity> event){
        event.async(
            Flux.fromIterable(event.getAfter())
                .flatMap(this::validateConfig)
        );
    }


    @EventListener
    public void handleTemplateEvent(EntityCreatedEvent<NotifyTemplateEntity> event){
        event.async(
            Flux.fromIterable(event.getEntity())
                .flatMap(this::validateTemplate)
        );
    }

    @EventListener
    public void handleTemplateEvent(EntitySavedEvent<NotifyTemplateEntity> event){
        event.async(
            Flux.fromIterable(event.getEntity())
                .flatMap(this::validateTemplate)
        );
    }

    @EventListener
    public void handleTemplateEvent(EntityModifyEvent<NotifyTemplateEntity> event){
        event.async(
            Flux.fromIterable(event.getAfter())
                .flatMap(this::validateTemplate)
        );
    }

    public Mono<Void> validateTemplate(NotifyTemplateEntity entity) {
        return this
            .getTemplateProvider(entity.getType(), entity.getProvider())
            .createTemplate(entity.toTemplateProperties())
            .then();
    }

    public Mono<Void> validateConfig(NotifyConfigEntity entity) {
        return this
            .getNotifierProvider(entity.getType(), entity.getProvider())
            .createNotifier(entity.toProperties())
            .flatMapMany(Notifier::close)
            .then();
    }


    public NotifierProvider getNotifierProvider(String type, String provider) {<FILL_FUNCTION_BODY>}

    public TemplateProvider getTemplateProvider(String type, String provider) {
        for (TemplateProvider prov : templateProviders) {
            if (prov.getType().getId().equalsIgnoreCase(type) && prov
                .getProvider()
                .getId()
                .equalsIgnoreCase(provider)) {
                return prov;
            }
        }
        throw new ValidationException("error.unsupported_notify_provider");
    }
}

        for (NotifierProvider prov : notifierProviders) {
            if (prov.getType().getId().equalsIgnoreCase(type) && prov
                .getProvider()
                .getId()
                .equalsIgnoreCase(provider)) {
                return prov;
            }
        }
        throw new ValidationException("error.unsupported_notify_provider");
    
<no_super_class>