class ImmutableAccessControlList implements AccessControlList {

    @Override
    public AccessControlList setForAllAuthorizationSubjects(final Permissions permissions) {
        checkNotNull(permissions, "set with the permissions to set");

        final AccessControlList result;

        if (entries.isEmpty()) {
            result = this;
        } else if (permissions.isEmpty()) {
            result = ImmutableAccessControlList.empty();
        } else {
            final Set<AclEntry> newAclEntries = stream() //
                    .map(AclEntry::getAuthorizationSubject) //
                    .map(authSubject -> AccessControlListModelFactory.newAclEntry(authSubject, permissions)) //
                    .collect(Collectors.toSet());
            result = of(newAclEntries);
        }

        return result;
    }

    private  ImmutableAccessControlList(final Map<AuthorizationSubject, AclEntry> theEntries);
    private  ImmutableAccessControlList(final Collection<AclEntry> theEntries);

}