title: What priority order for MIME types (contain in accept header from request) consider by Jersey while selecting the appropriate restful endpoint
body: <p>Please refer to the below code snippet</p>
  
  <p>@Path("/hello")</p>
  
  <pre><code>public class Hello {
  
    @GET
    @Produces(MediaType.APPLICATION_XHTML_XML)
    public String sayApplicationXhtmlXml() {
      System.out.println("Application XHTML XML IS ACCEPTED");  
      return "Hello Jersey";
    }
  
  
    @GET
    @Produces("*/*")
    public String sayAllMimeTypes() {
      System.out.println("All MIME TYPES IS ACCEPTED");
      return "&lt;?xml version=\"1.0\"?&gt;" + "&lt;hello&gt; Hello " + "&lt;/hello&gt;";
    }
  }
  </code></pre>
  
  <p>When I am sending request from firefox with header </p>
  
  <pre><code>Accept: text/html,application/xhtml+xml,application/xml;q=0.9,asterisk/asterisk;q=0.8
  </code></pre>
  
  <p>which is default header of firefox.</p>
  
  <p>output is</p>
  
  <pre><code>ALL MIME TYPES IS ACCEPTED
  </code></pre>
  
  <p>I think something wrong it.</p>
  
  <p>As per my understanding, output should be </p>
  
  <pre><code>Application XHTML XML IS ACCEPTED 
  </code></pre>
  
  <p>because <code>application/xhtml+xml</code> appears before <code>"asterisk/asterisk"</code> in <code>Accept</code> header (As per rule according to which if default value of q=1.0 for both of them so whoever appears first should be given higher priority)</p>