public static boolean isClassBelowPackage(Class<?> theClass, List<?> packageList) {
        String classPackage = theClass.getPackage().getName();
        for (Object packageName : packageList) {
            if (packageName != null) {
                if (classPackage.startsWith(packageName.toString())) {
                    return true;
                }
            }
        }
        return false;
    }
public static boolean isClassBelowPackage ( Class < ? > theClass , List < ? > packageList ) { String classPackage = theClass . getPackage ( ) . getName ( ) ; for ( Object packageName : packageList ) { if ( packageName != null ) { if ( classPackage . startsWith ( packageName . toString ( ) ) ) { return true ; } } } return false ; }
Returns whether the specified class is either within one of the specified packages or
within a subpackage of one of the packages

@param theClass The class
@param packageList The list of packages
@return true if it is within the list of specified packages