AccessControlListModelFactory { public static Permissions newUnmodifiablePermissions(final Permission permission, final Permission... furtherPermissions) { return new MutablePermissions(Collections.unmodifiableSet(EnumSet.of(permission, furtherPermissions))); } private  AccessControlListModelFactory(); static Permissions noPermissions(); static Permissions allPermissions(); static Permissions newPermissions(final Collection<Permission> permissions); static Permissions newPermissions(final Permission permission, final Permission... furtherPermissions); static Permissions newUnmodifiablePermissions(final Permission permission,
            final Permission... furtherPermissions); static AclEntry newAclEntry(final AuthorizationSubject authorizationSubject, final Permission permission,
            final Permission... furtherPermissions); static AclEntry newAclEntry(final AuthorizationSubject authorizationSubject,
            final Iterable<Permission> permissions); static AclEntry newAclEntry(final JsonObject jsonObject); static AclEntry newAclEntry(final CharSequence authorizationSubjectId, final JsonValue permissionsValue); static AccessControlListBuilder newAclBuilder(); static AccessControlListBuilder newAclBuilder(final Iterable<AclEntry> aclEntries); static AccessControlListBuilder newAclBuilder(final Optional<? extends Iterable<AclEntry>> aclEntries); static AccessControlList emptyAcl(); static AccessControlList newAcl(final AclEntry entry, final AclEntry... furtherEntries); static AccessControlList newAcl(final Iterable<AclEntry> entries); static AccessControlList newAcl(final JsonObject jsonObject); static AccessControlList newAcl(final String jsonString);  }
@Test(expected = UnsupportedOperationException.class) public void unmodifiablePermissionsAreUnmodifiable() { final Permissions unmodifiablePermissions = AccessControlListModelFactory.newUnmodifiablePermissions(Permission.READ, Permission.WRITE); unmodifiablePermissions.add(Permission.ADMINISTRATE); }