code: public String toUrl(String searchString, Map<String, Navigation> navigations) throws UrlBeautifier.UrlBeautificationException {
      StringBuilder pathSegmentLookup = new StringBuilder("/");
      Query query = createQuery();
      if (StringUtils.isNotBlank(searchString)) {
        query.setQuery(searchString);
      }
      URIBuilder uri = new URIBuilder();
      uri.setPath("");
      if (MapUtils.isNotEmpty(navigations)) {
        for (Navigation n : navigations.values()) {
          for (Refinement r : n.getRefinements()) {
            if (r instanceof RefinementRange) {
              RefinementRange rr = (RefinementRange) r;
              query.addRangeRefinement(n.getName(), rr.getLow(), rr.getHigh());
            } else {
              query.addValueRefinement(n.getName(), ((RefinementValue) r).getValue());
            }
          }
        }
      }
      Map<String, Navigation> groupedRefinements = getDistinctRefinements(query);
      addRefinements(query.getQuery(), groupedRefinements, pathSegmentLookup, uri);
      addReferenceBlock(pathSegmentLookup, uri);
      addAppend(uri);
      addUnmappedRefinements(groupedRefinements, uri);
      String uriString = uri.toString();
      return uriString.startsWith("null") ? uriString.substring(4) : uriString;
    }
docs: <code>
  Convert a search term and a list of refinements into a beautified URL.
  Each refinement that has a mapping will be turned into a path segment.
  If a mapping has been created for search, the search term will also be
  placed into a URL path segment.
  </code>
  
  @param searchString
  The current search state.
  @param navigations
  The current refinement state
  
  @throws UrlBeautifier.UrlBeautificationException