class WebComponentExporterUtils {

    @SuppressWarnings({ "unchecked", "rawtypes" })
    public static Set<WebComponentExporterFactory> getFactories(
            Set<Class<?>> classes) {
        Set<WebComponentExporterFactory> factories = new HashSet<>();
        classes.stream().filter(WebComponentExporter.class::isAssignableFrom)
                .filter(WebComponentExporterUtils::isEligible)
                .map(clazz -> new DefaultWebComponentExporterFactory(clazz))
                .forEach(factories::add);

        classes.stream()
                .filter(WebComponentExporterFactory.class::isAssignableFrom)
                .filter(clazz -> !Modifier.isAbstract(clazz.getModifiers()))
                .filter(clazz -> !clazz
                        .equals(DefaultWebComponentExporterFactory.class))
                .map(ReflectTools::createInstance)
                .map(WebComponentExporterFactory.class::cast)
                .forEach(factories::add);
        return factories;
    }

    private  WebComponentExporterUtils();

}