question: public static boolean isDomainOrSubDomain ( String domainName , List < String > domainNames ) { if ( CollectionUtils . isEmpty ( domainNames ) ) { return false ; } for ( String domainToCheck : domainNames ) { if ( domainName . equals ( domainToCheck ) || ( domainName . endsWith ( domainToCheck ) && domainName . endsWith ( "." + domainToCheck ) ) ) { return true ; } } return false ; }
target:  Checks if specified domain name is in the list of the domainNames or if it is sub-domain of any domain in the list.