private void addCriterionsToCriteria(Criteria criteria, Criterion... criterion) {
        if (criteria != null) {
            for (Criterion c : criterion) {
                if (c != null) {
                    criteria.add(c);
                }
            }
        }
    }
private void addCriterionsToCriteria ( Criteria criteria , Criterion ... criterion ) { if ( criteria != null ) { for ( Criterion c : criterion ) { if ( c != null ) { criteria . add ( c ) ; } } } }
Helper method: Adds all criterions to the criteria (if not null).

@param criteria
@param criterion