class AcmFilesystemMailTemplateConfigurationService implements AcmMailTemplateConfigurationService {

    @Override
    public List<EmailTemplateConfiguration> getMatchingTemplates(String email, String objectType, EmailSource source, List<String> actions)
            throws AcmEmailConfigurationException
    {
        List<EmailTemplateConfiguration> configurations = getTemplateConfigurations();
        Stream<EmailTemplateConfiguration> filteredConfigurations = configurations.stream()
                .filter(c -> c.getObjectTypes().contains(objectType)).filter(c -> c.getActions().containsAll(actions))
                .filter(c -> c.getSource().equals(source)).filter(c -> matches(c.getEmailPattern(), email));

        return filteredConfigurations.collect(Collectors.toList());
    }

}