code: private JdepsFilter dependencyFilter(JdepsConfiguration config) {
          // Filter specified by -filter, -package, -regex, and --require options
          JdepsFilter.Builder builder = new JdepsFilter.Builder();
  
          // source filters
          builder.includePattern(options.includePattern);
  
          // target filters
          builder.filter(options.filterSamePackage, options.filterSameArchive);
          builder.findJDKInternals(options.findJDKInternals);
  
          // --require
          if (!options.requires.isEmpty()) {
              options.requires.stream()
                  .forEach(mn -> {
                      Module m = config.findModule(mn).get();
                      builder.requires(mn, m.packages());
                  });
          }
          // -regex
          if (options.regex != null)
              builder.regex(options.regex);
          // -package
          if (!options.packageNames.isEmpty())
              builder.packages(options.packageNames);
          // -filter
          if (options.filterRegex != null)
              builder.filter(options.filterRegex);
  
          return builder.build();
      }
docs: Returns a filter used during dependency analysis