code: public void removeQuery(String id) {
  		int index = getElementPosition(id);
  		QueryControllerEntity element = entities.get(index);
  
  		if (element instanceof QueryControllerQuery) {
  			entities.remove(index);
  			fireElementRemoved(element);
  			return;
  		} else {
  			QueryControllerGroup group = (QueryControllerGroup) element;
  			Vector<QueryControllerQuery> queries_ingroup = group.getQueries();
  			for (QueryControllerQuery query : queries_ingroup) {
  				if (query.getID().equals(id)) {
  					fireElementRemoved(group.removeQuery(query.getID()), group);
  					return;
  				}
  			}
  		}
  	}
docs: Removes a query from the vector QueryControllerEntity