public int getQueryGroupID(final Query aQuery) {
        /* Iterates over the set of query groups. */
        for (int iQueryGroup = 0; iQueryGroup < queryGroupsMap.size(); iQueryGroup++) {
            final Set<Query> currentQuerySet = queryGroupsMap.get(iQueryGroup);
            
            if (currentQuerySet.contains(aQuery)) {
                return iQueryGroup;
            }
        }
        
        return -1;
    }