docs: public static <T> BeansXml merge(Iterable<? extends T> items, Function<T, BeansXml> function, boolean removeDuplicates) {
          List<Metadata<String>> alternatives = new ArrayList<>();
          List<Metadata<String>> alternativeStereotypes = new ArrayList<>();
          List<Metadata<String>> decorators = new ArrayList<>();
          List<Metadata<String>> interceptors = new ArrayList<>();
          List<Metadata<Filter>> includes = new ArrayList<>();
          List<Metadata<Filter>> excludes = new ArrayList<>();
          boolean isTrimmed = false;
          URL beansXmlUrl = null;
          for (T item : items) {
              BeansXml beansXml = function.apply(item);
              addTo(alternatives, beansXml.getEnabledAlternativeClasses(), removeDuplicates);
              addTo(alternativeStereotypes, beansXml.getEnabledAlternativeStereotypes(), removeDuplicates);
              addTo(decorators, beansXml.getEnabledDecorators(), removeDuplicates);
              addTo(interceptors, beansXml.getEnabledInterceptors(), removeDuplicates);
              includes.addAll(beansXml.getScanning().getIncludes());
              excludes.addAll(beansXml.getScanning().getExcludes());
              isTrimmed = beansXml.isTrimmed();
              /*
               * provided we are merging the content of multiple XML files, getBeansXml() returns an InputStream representing the last one
               */
              beansXmlUrl = beansXml.getUrl();
          }
          return new BeansXmlImpl(alternatives, alternativeStereotypes, decorators, interceptors, new ScanningImpl(includes, excludes), beansXmlUrl,
                  BeanDiscoveryMode.ALL, null, isTrimmed);
      }