public <T> Optional<Condition> getSetCondition(
            final Field<T> field,
            final Selection<T> criteria) {
        if (criteria == null || criteria.isMatchAll()) {
            return Optional.empty();
        }
        return Optional.of(field.in(criteria.getSet()));
    }
Used to build jOOQ conditions from criteria sets

@param field    The jOOQ field being set queried
@param criteria The criteria to apply
@param <T>      The type of the range
@return A condition that applies the given set.
stroom-db-util/src/main/java/stroom/db/util/JooqHelper.java