code: private static String parseVersionId(String query) {
          if (query != null) {
              String[] params = VERSION_ID_PATTERN.split(query);
              for (String param : params) {
                  if (param.startsWith("versionId=")) {
                      return decode(param.substring(10));
                  }
              }
          }
          return null;
      }
docs: Attempts to parse a versionId parameter from the query
  string.
  
  @param query the query string to parse (possibly null)
  @return the versionId (possibly null)