protected Collection<ModelType> getModelInstances(
            ModeledPermissions<? extends EntityModel> targetEntity,
            Collection<PermissionType> permissions) {

        // Create new collection of models by manually converting each permission
        Collection<ModelType> models = new ArrayList<ModelType>(permissions.size());
        for (PermissionType permission : permissions)
            models.add(getModelInstance(targetEntity, permission));

        return models;

    }
Returns a collection of model objects which are based on the given
permissions and target entity.

@param targetEntity
    The entity to whom this permission is granted.

@param permissions
    The permissions to use to produce the returned model objects.

@return
    A collection of model objects which are based on the given
    permissions and target entity.
extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/permission/ModeledPermissionService.java