assertFalse(dp1.implies(null));
assertFalse(dp1.implies(new ServicePermission("aaa", "accept")));
}
public void testElements() throws Exception {
Permission p = new DelegationPermission("\"AAA\" \"BBB\"");
PermissionCollection pc = p.newPermissionCollection();
try {
pc.elements().nextElement();
fail("expected NoSuchElementException");
} catch (NoSuchElementException e) {
}
Enumeration<Permission> en = pc.elements();
assertNotNull(en);
assertFalse(en.hasMoreElements());
Permission sp1 = new DelegationPermission("\"DDD\" \"BBB\"");
Permission sp2 = new DelegationPermission("\"CCC\" \"BBB\"");
pc.add(sp1);
en = pc.elements();
assertTrue(en.hasMoreElements());
assertTrue(sp1.equals(en.nextElement()));
assertFalse(en.hasMoreElements());