check("*.foo.sun.com", "*.sun.com", false);
check("*.sun.com", "sun.com", false);
}
private static void check(String src, String dst, boolean res) {
DiscoveryPermission psrc = new DiscoveryPermission(src);
DiscoveryPermission pdst = new DiscoveryPermission(dst);
if (psrc.implies(pdst) != res) {
throw new SecurityException(src + (res ? " does not imply " :
" implies ") + dst);
}