public static boolean excludeByPackage(String pkg,List<String> excludePkg){
  for (  String ep : excludePkg) {
    if (pkg.matches(ep)) {
      return true;
    }
  }
  return false;
}

public static boolean excludeByPackage ( String pkg , List < String > excludePkg ) { for ( String ep : excludePkg ) { if ( pkg . matches ( ep ) ) { return true ; } } return false ; }
compare a package with a list of packages to determine whether the package should be excluded or not .
