private static void addFilterInstances(
            FilterBindings.Builder builder, ServerConfig config, FilterChainRepository filterRepository) {
        Set<String> filterIds = new HashSet<>();
        config.filter().forEach(filterBinding -> filterIds.add(filterBinding.id()));
        config.defaultFilters().forEach(defaultFilter -> filterIds.add(defaultFilter.filterId()));
        for (String filterId : filterIds) {
            Object filterInstance = getFilterInstance(filterRepository, filterId);
            if (filterInstance instanceof RequestFilter && filterInstance instanceof ResponseFilter) {
                throw new IllegalArgumentException("The filter " + filterInstance.getClass().getName()
                        + " is unsupported since it's both a RequestFilter and a ResponseFilter.");
            } else if (filterInstance instanceof RequestFilter) {
                builder.addRequestFilter(filterId, (RequestFilter)filterInstance);
            } else if (filterInstance instanceof ResponseFilter) {
                builder.addResponseFilter(filterId, (ResponseFilter)filterInstance);
            } else if (filterInstance == null) {
                throw new IllegalArgumentException("No http filter with id " + filterId);
            } else {
                throw new IllegalArgumentException("Unknown filter type: " + filterInstance.getClass().getName());
            }
        }
    }
Provides filter bindings based on vespa config.

@author Oyvind Bakksjo
@author bjorncs
container-disc/src/main/java/com/yahoo/container/jdisc/FilterBindingsProvider.java