docs: public static String expand(String tmpl, String tn, int p, long gn, Date dt, TimeZone tz) {
  
          Preconditions.checkArgument(
                  tmpl != null && !tmpl.trim().isEmpty(),
                  "null or empty format string"
                  );
  
          int conversionMask = conversionMaskFor(tmpl);
          boolean hasDateConversion = (conversionMask & DATE) == DATE;
          boolean hasTableConversion = (conversionMask & TABLE) == TABLE;
  
          Preconditions.checkArgument(
                  (dt != null && hasDateConversion) || !hasDateConversion,
                  "null date"
                  );
          Preconditions.checkArgument(
                  (tn != null && !tn.trim().isEmpty() && hasTableConversion) || !hasTableConversion,
                  "null or empty table name"
                  );
  
          SimpleDateFormat dateFormatter = null;
          if (hasDateConversion) {
              dateFormatter = new SimpleDateFormat(DATE_FORMAT);
              if (tz != null) {
                  dateFormatter.setTimeZone(tz);
              }
          }
  
          StringBuilder sb = new StringBuilder(tmpl.length()+256).append(tmpl);
          for (int i = 0; i < sb.length();) {
              if (isEscaped(sb,i)) {
                  sb.deleteCharAt(i);
                  i += 1;
              } else if (isExpandable(sb,i)) {
                  String r = "";
                  switch(sb.charAt(i+1)) {
                  case 't':
                      r = tn;
                      break;
                  case 'g':
                      r = Long.toString(gn, Character.MAX_RADIX);
                      break;
                  case 'd':
                      r = dateFormatter.format(dt);
                      break;
                  case 'p':
                      r = Integer.toString(p);
                      break;
                  }
                  sb.replace(i,i+2,r);
                  i += r.length();
              } else {
                  i += 1;
              }
          }
          return sb.toString();
      }