protected <T> void batchPermissionUpdates(
            Collection<T> objects, Consumer<Collection<T>> consumer)
            throws GuacamoleException {

        // Split the original collection into views, each no larger than the
        // configured batch size, and call the collector function with each
        Iterables.partition(objects, environment.getBatchSize())
                .forEach(batch -> consumer.accept(batch));
    }
Runs the provided consumer function on subsets of the original collection
of objects, with each subset being no larger than the maximum batch size
configured for the JDBC environment. Any permission update that involves
passing potentially-large lists of models to a mapper should use this
method to perform the update to ensure that the maximum number of
parameters for an individual query is not exceeded.

@param <T>
    The type of object stored in the provided objects list, and consumed
    by the provided consumer.

@param objects
    A collection of objects to be partitioned.

@param consumer
    A function that will consume subsets of the objects from the provided
    collection of objects, performing any update as needed.

@throws GuacamoleException
    If the batch size cannot be determined for the JDBC environment.
extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/permission/ModeledPermissionService.java