code: @Override
    public Filters.Filter adapt(FilterAdapterContext context, FilterList filter) throws IOException {
      try (ContextCloseable ignored = context.beginFilterList(filter)) {
        List<Filters.Filter> childFilters = collectChildFilters(context, filter);
        if (childFilters.isEmpty()) {
          return null;
        } else if (childFilters.size() == 1) {
          return childFilters.get(0);
        } else if (filter.getOperator() == Operator.MUST_PASS_ALL) {
          ChainFilter chain = FILTERS.chain();
          for (Filters.Filter filterModel : childFilters) {
            chain.filter(filterModel);
          }
          return chain;
        } else {
          InterleaveFilter interleave = FILTERS.interleave();
          for (Filters.Filter filterModel : childFilters) {
            interleave.filter(filterModel);
          }
          return interleave;
        }
      }
    }
docs: {@inheritDoc}