class IncludeExcludeFilter {

  @VisibleForTesting
  static void mainHelper(String[] args, java.io.InputStream inStream) throws java.io.IOException {
    Configuration.initConfig(args);
    IncludeExcludeFilter filter = IncludeExcludeFilter.fromConfiguration();
    System.out.println("Rules:");
    Stream.concat(filter.prefixIncludeRules.stream(), filter.prefixExcludeRules.stream())
        .forEach(rule -> System.out.println("*** " + rule));
    Stream.concat(
        filter.regexIncludeRules.values().stream().filter(list -> !list.isEmpty()),
        filter.regexExcludeRules.values().stream().filter(list -> !list.isEmpty()))
        .forEach(list -> list.stream().forEach(rule -> System.out.println("*** " + rule)));
    System.out.println();

    System.out.println("Enter test value(s)");

    Scanner in = new Scanner(inStream);
    while (in.hasNext()) {
      String value = in.next();
      System.out.println(value);
      for (ItemType itemType : ItemType.values()) {
        System.out.println("  as " + itemType.name() + ": "
            + filter.isAllowed(value, itemType));
      }
      System.out.println();
    }
  }

  @VisibleForTesting  IncludeExcludeFilter(List<Rule> rules);

}