docs: public static Collection<String> filterClassesBasedOnBeansXML(BeansXml beansXml, final ResourceLoader resourceLoader, Set<String> classes) {
          if (beansXml != null && beansXml.getBeanDiscoveryMode().equals(BeanDiscoveryMode.NONE)) {
              // if the integrator for some reason ignored the "none" flag make sure we do not process the archive
              return Collections.emptySet();
          }
          Function<Metadata<Filter>, Predicate<String>> filterToPredicateFunction = new Function<Metadata<Filter>, Predicate<String>>() {
  
              @Override
              public Predicate<String> apply(Metadata<Filter> from) {
                  return new FilterPredicate(from, resourceLoader);
              }
  
          };
          Collection<String> classNames;
          if (beansXml != null && beansXml.getScanning() != null) {
              Collection<Metadata<Filter>> includeFilters;
              if (beansXml.getScanning().getIncludes() != null) {
                  includeFilters = beansXml.getScanning().getIncludes();
              } else {
                  includeFilters = Collections.emptyList();
              }
              Collection<Metadata<Filter>> excludeFilters;
              if (beansXml.getScanning().getExcludes() != null) {
                  excludeFilters = beansXml.getScanning().getExcludes();
              } else {
                  excludeFilters = Collections.emptyList();
              }
              /*
               * Take a copy of the transformed collection, this means that the
               * filter predicate is only built once per filter predicate
               */
              Collection<Predicate<String>> includes;
              if (includeFilters.isEmpty()) {
                  includes = Collections.emptyList();
              } else {
                  includes = new ArrayList<Predicate<String>>(includeFilters.size());
                  for (Metadata<Filter> includeFilter : includeFilters) {
                      includes.add(filterToPredicateFunction.apply(includeFilter));
                  }
              }
              Collection<Predicate<String>> excludes;
              if (excludeFilters.isEmpty()) {
                  excludes = Collections.emptyList();
              } else {
                  excludes = new ArrayList<Predicate<String>>(excludeFilters.size());
                  for (Metadata<Filter> excludeFilter : excludeFilters) {
                      excludes.add(filterToPredicateFunction.apply(excludeFilter));
                  }
              }
              Predicate<String> filters = new ScanningPredicate<String>(includes, excludes);
              classNames = new HashSet<>();
              for (String beanClass : classes) {
                  if (filters.test(beanClass)) {
                      classNames.add(beanClass);
                  }
              }
          } else {
              classNames = classes;
          }
          return classNames;
      }