### Question:
AllowAllPolicy extends Policy { public AllowAllPolicy() { super(); perms = new AllPermissionCollection(); perms.add(new AllPermission()); } AllowAllPolicy(); @Override PermissionCollection getPermissions(CodeSource codesource);  }### Answer:
@Test public void testAllowAllPolicy() throws Exception { final AllowAllPolicy policy = new AllowAllPolicy(); final PermissionCollection collection = policy.getPermissions((CodeSource) null); final Enumeration<Permission> elements = collection.elements(); assertTrue("Policy should contain at least one permission", elements.hasMoreElements()); assertTrue("The first permission should allow everything.", elements.nextElement() instanceof AllPermission); }