code: public QueryControllerQuery addQuery(String queryStr, String queryId, String groupId) {
  		int position = getElementPosition(queryId);
  
  		QueryControllerQuery query = new QueryControllerQuery(queryId);
  		query.setQuery(queryStr);
  		QueryControllerGroup group = getGroup(groupId);
  		if (group == null) {
  		    group = new QueryControllerGroup(groupId);
              entities.add(group);
              fireElementAdded(group);
  		}
  		if (position == -1) {
  			group.addQuery(query);
  			fireElementAdded(query, group);
  		} else {
  			group.updateQuery(query);
  			fireElementChanged(query, group);
  		}
  		return query;
  	}
docs: Creates a new query into a group and adds it to the vector
  QueryControllerEntity