title: Why java.net.URI isAbsolute() method return true for an URI that have fragment?
body: <p>My goal is to follow the term of <code>absolute-URI = scheme &quot;:&quot; hier-part [ &quot;?&quot; query ]</code> from Appendix A. Collected ABNF for URI from [RFC3986]</p>
  <p>My understanding that is <code>absolute-uri</code> can't have <code>fragment</code>. I tested it with <code>java.net.URI</code>. I checked that <code>isAbsolute() method</code> only check for the scheme != null instead of checking the entire String.</p>
  <p>My expected result was that the URI's isAbsolute() method return:</p>
  <ol>
  <li>false for Uri <code>http://wwww.example.com/index.html#Related</code> because it has fragment.</li>
  <li>true for Uri <code>http://www.example.com/index.html</code>.</li>
  </ol>
  <p>My actual result was that the URI's isAbsolute() method return true.</p>
  <pre><code>import org.junit.jupiter.api.Assertions;
  import org.junit.jupiter.api.Test;
  import org.junit.jupiter.api.TestInstance;
  
  import java.net.URI;
  import java.net.URISyntaxException;
  
  @TestInstance(TestInstance.Lifecycle.PER_CLASS)
  class RegExTest {
  
    @Test
    void validAbsoluteUri() throws URISyntaxException {
      URI uri1 = new URI(&quot;http://www.example.com/index.html#Related&quot;);
      Assertions.assertEquals(false, uri1.isAbsolute());
    }
  }
  </code></pre>