code: private static String decode(final String str) {
          if (str == null) {
              return null;
          }
  
          for (int i = 0; i < str.length(); ++i) {
              if (str.charAt(i) == '%') {
                  return decode(str, i);
              }
          }
  
          return str;
      }
docs: Percent-decodes the given string, with a fast path for strings that
  are not percent-encoded.
  
  @param str the string to decode
  @return the decoded string