code: protected static String encodeTags(Map<String, String> tags) {
          if (tags == null) {
              return null;
          }
          try {
              StringBuilder builder = new StringBuilder();
              boolean first = true;
              for (Entry<String, String> entry : tags.entrySet()) {
                  if (!first) {
                      builder.append(',');
                  }
                  builder.append(URLEncoder.encode(entry.getKey(), "UTF-8")); //$NON-NLS-1$
                  builder.append(':');
                  builder.append(URLEncoder.encode(entry.getValue(), "UTF-8")); //$NON-NLS-1$
                  first = false;
              }
              return builder.toString();
          } catch (UnsupportedEncodingException e) {
              e.printStackTrace();
              return ""; //$NON-NLS-1$
          }
      }
docs: Encodes the tags into the format expected by HM.
  @param tags