class ImmutablePermissions extends AbstractSet<String> implements Permissions {

    @Override
    public JsonArray toJson() {
        final JsonArrayBuilder jsonArrayBuilder = JsonFactory.newArrayBuilder();
        permissions.forEach(jsonArrayBuilder::add);
        return jsonArrayBuilder.build();
    }

    private  ImmutablePermissions(final Set<String> permissions);

}