public boolean localHostOrDomainIs(String host,String domain){
  return domain.startsWith(host);
}

public boolean localHostOrDomainIs ( String host , String domain ) { return domain . startsWith ( host ) ; }
is true if the host name matches exactly the specified host name , or if there is no domain name part in the host name , but the unqualified host name matches .
