docs: public static HashMap<String, String> getUrlVariables(final Filter filter) {
          final HashMap<String, String> vars = new HashMap<String, String>();
  
          for (final FilterTag filterTag : filter.getFilterTags()) {
              final Tag tag = filterTag.getTag();
              final Integer tagState = filterTag.getTagState();
  
              if (tagState == CommonFilterConstants.MATCH_TAG_STATE) {
                  vars.put(CommonFilterConstants.MATCH_TAG + tag.getTagId(), CommonFilterConstants.MATCH_TAG_STATE + "");
              } else if (tagState == CommonFilterConstants.NOT_MATCH_TAG_STATE) {
                  vars.put(CommonFilterConstants.MATCH_TAG + tag.getTagId(), CommonFilterConstants.NOT_MATCH_TAG_STATE + "");
              } else if (tagState == CommonFilterConstants.GROUP_TAG_STATE) {
                  vars.put(CommonFilterConstants.GROUP_TAG + tag.getTagId(), CommonFilterConstants.GROUP_TAG_STATE + "");
              }
          }
  
          for (final FilterCategory filterCategory : filter.getFilterCategories()) {
              final Category category = filterCategory.getCategory();
              final Project project = filterCategory.getProject();
  
              if (filterCategory.getCategoryState() == CommonFilterConstants.CATEGORY_INTERNAL_AND_STATE) {
                  vars.put(
                          CommonFilterConstants.CATEORY_INTERNAL_LOGIC + category.getCategoryId() + (project == null ? "" : "-" + project
                                  .getProjectId()),
                          CommonFilterConstants.AND_LOGIC);
              }
  
              // don't add a url var for the "or" internal logic, as this is the
              // default
  
              else if (filterCategory.getCategoryState() == CommonFilterConstants.CATEGORY_EXTERNAL_OR_STATE) {
                  vars.put(
                          CommonFilterConstants.CATEORY_EXTERNAL_LOGIC + category.getCategoryId() + (project == null ? "" : "-" + project
                                  .getProjectId()),
                          CommonFilterConstants.OR_LOGIC);
              }
  
              // don't add a url var for the "and" external logic, as this is the
              // default
          }
  
          int count = 1;
          for (final FilterLocale filterLocale : filter.getFilterLocales()) {
              final Integer localeState = filterLocale.getLocaleState();
  
              if (localeState == CommonFilterConstants.MATCH_TAG_STATE) {
                  vars.put(CommonFilterConstants.MATCH_LOCALE + count, filterLocale.getLocaleName() + CommonFilterConstants.MATCH_TAG_STATE);
              } else if (localeState == CommonFilterConstants.NOT_MATCH_TAG_STATE) {
                  vars.put(CommonFilterConstants.MATCH_LOCALE + count,
                          filterLocale.getLocaleName() + CommonFilterConstants.NOT_MATCH_TAG_STATE);
              }
              count++;
          }
  
          boolean foundFilterField = false;
          boolean foundFilterFieldLogic = false;
          for (final FilterField filterField : filter.getFilterFields()) {
              try {
                  vars.put(filterField.getField(), URLEncoder.encode(filterField.getValue(), "UTF-8"));
              } catch (UnsupportedEncodingException e) {
                  throw new RuntimeException(e);
              }
              if (!filterField.getField().equals(CommonFilterConstants.LOGIC_FILTER_VAR)) foundFilterField = true;
              else foundFilterFieldLogic = true;
          }
  
          /*
           * if we have found some filter fields, but did not find the filter
           * logic, use the default value
           */
          if (foundFilterField && !foundFilterFieldLogic)
              vars.put(CommonFilterConstants.LOGIC_FILTER_VAR, FilterConstants.LOGIC_FILTER_VAR_DEFAULT_VALUE);
  
          return vars;
      }