class MutablePermissions extends AbstractSet<Permission> implements Permissions {

    @Override
    public JsonObject toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate) {
        // explicitly DO NOT use the schemaVersion in the predicate - as there is no schema version on the field definitions
        final JsonObjectBuilder jsonObjectBuilder = JsonFactory.newObjectBuilder();
        for (final Permission permission : Permission.values()) {
            jsonObjectBuilder.set(permission.toJsonKey(), JsonFactory.newValue(values.contains(permission)));
        }
        return jsonObjectBuilder.build();
    }

      MutablePermissions(final Set<Permission> permissions);
    public  MutablePermissions(final Collection<Permission> permissions);

}