docs: private static String getRelativePath(final String basePath, final String refPath, final String sep) {
          final StringBuilder upPathBuffer = new StringBuilder(128);
          final StringBuilder downPathBuffer = new StringBuilder(128);
          final StringTokenizer mapTokenizer = new StringTokenizer(normalizePath(basePath, File.separator), File.separator);
          final StringTokenizer topicTokenizer = new StringTokenizer(normalizePath(refPath, File.separator), File.separator);
  
          while (mapTokenizer.countTokens() > 1
                  && topicTokenizer.countTokens() > 1) {
              final String mapToken = mapTokenizer.nextToken();
              final String topicToken = topicTokenizer.nextToken();
              boolean equals;
              if (OS_NAME.toLowerCase().contains(OS_NAME_WINDOWS)) {
                  //if OS is Windows, we need to ignore case when comparing path names.
                  equals = mapToken.equalsIgnoreCase(topicToken);
              } else {
                  equals = mapToken.equals(topicToken);
              }
  
              if (!equals) {
                  if (mapToken.endsWith(COLON) ||
                          topicToken.endsWith(COLON)) {
                      //the two files are in different disks under Windows
                      return refPath;
                  }
                  upPathBuffer.append("..");
                  upPathBuffer.append(sep);
                  downPathBuffer.append(topicToken);
                  downPathBuffer.append(sep);
                  break;
              }
          }
  
          while (mapTokenizer.countTokens() > 1) {
              mapTokenizer.nextToken();
  
              upPathBuffer.append("..");
              upPathBuffer.append(sep);
          }
  
          while (topicTokenizer.hasMoreTokens()) {
              downPathBuffer.append(topicTokenizer.nextToken());
              if (topicTokenizer.hasMoreTokens()) {
                  downPathBuffer.append(sep);
              }
          }
  
          return upPathBuffer.append(downPathBuffer).toString();
      }