code: public void normalizeCase() {
          // Scheme and host should be lowercase
          String scheme = uri.getScheme();
          String host = uri.getHost();
          String rURI = toString();
          if (scheme != null) {
              String lc = scheme.toLowerCase();
              if (!scheme.equals(lc)){
                  rURI = rURI.replaceFirst(scheme, lc);
              }
          }
          if (host != null) {
              String lc = host.toLowerCase();
              if (!host.equals(lc)){
                  rURI = rURI.replaceFirst(host, lc);
              }
          }
  
          // Percent-encoded characters should be uppercase
          if (rURI.indexOf('%') != -1) {
              Matcher m = PERCENT_ENCODED.matcher(rURI);
  
              StringBuffer sb = new StringBuffer();
              int lastEnd = 0;
              while(m.find()) {
                  sb.append(rURI,lastEnd, m.start());
                  sb.append(m.group().toUpperCase());
                  lastEnd = m.end();
              }
              sb.append(rURI, lastEnd, rURI.length());
              rURI = sb.toString();
          }
          uri = URI.create(rURI);
      }
docs: Case Normalization
  @see "RFC3986 6.2.2.1"