code: public String encodedUsername() {
          if (username.isEmpty()) return "";
          int usernameStart = scheme.length() + 3; // "://".length() == 3.
          int usernameEnd = delimiterOffset(url, usernameStart, url.length(), ":@");
          return url.substring(usernameStart, usernameEnd);
      }
docs: Returns the username, or an empty string if none is set.
  
  <p><table summary="">
  <tr><th>URL</th><th>{@code encodedUsername()}</th></tr>
  <tr><td>{@code http://host/}</td><td>{@code ""}</td></tr>
  <tr><td>{@code http://username@host/}</td><td>{@code "username"}</td></tr>
  <tr><td>{@code http://username:password@host/}</td><td>{@code "username"}</td></tr>
  <tr><td>{@code http://a%20b:c%20d@host/}</td><td>{@code "a%20b"}</td></tr>
  </table>