code: public List<String> encodedPathSegments() {
          int pathStart = url.indexOf('/', scheme.length() + 3);
          int pathEnd = delimiterOffset(url, pathStart, url.length(), "?#");
          List<String> result = new ArrayList<>();
          for (int i = pathStart; i < pathEnd; ) {
              i++; // Skip the '/'.
              int segmentEnd = delimiterOffset(url, i, pathEnd, '/');
              result.add(url.substring(i, segmentEnd));
              i = segmentEnd;
          }
          return result;
      }
docs: Returns a list of encoded path segments like {@code ["a", "b", "c"]} for the URL {@code
  http://host/a/b/c}. This list is never empty though it may contain a single empty string.
  
  <p><table summary="">
  <tr><th>URL</th><th>{@code encodedPathSegments()}</th></tr>
  <tr><td>{@code http://host/}</td><td>{@code [""]}</td></tr>
  <tr><td>{@code http://host/a/b/c}</td><td>{@code ["a", "b", "c"]}</td></tr>
  <tr><td>{@code http://host/a/b%20c/d}</td><td>{@code ["a", "b%20c", "d"]}</td></tr>
  </table>