title: @Produces collection in JAXRS / RestEasy
body: <p>I found some strange behaviour that I cannot understand.</p>
  
  <p>I have tested 4 similar examples:</p>
  
  <h1>1</h1>
  
  <pre><code>@GET
  @Produces(MediaType.APPLICATION_JSON)
  public Response produce() {
      List&lt;Book&gt; books = Arrays
              .asList(new Book[] { 
                      new Book("aaa", "AAA", "12345"), 
                      new Book("bbb", "BBB", "09876") 
                      });
      return Response.ok(books).build();
  }
  </code></pre>
  
  <h1>2</h1>
  
  <pre><code>@GET
  @Produces(MediaType.APPLICATION_JSON)
  public List&lt;Book&gt; produce() {
      List&lt;Book&gt; books = Arrays
              .asList(new Book[] { 
                      new Book("aaa", "AAA", "12345"), 
                      new Book("bbb", "BBB", "09876") 
                      });
      return books;
  }
  </code></pre>
  
  <h1>3</h1>
  
  <pre><code>@GET
  @Produces(MediaType.APPLICATION_XML)
  public List&lt;Book&gt; produce() {
      List&lt;Book&gt; books = Arrays
              .asList(new Book[] { 
                      new Book("aaa", "AAA", "12345"), 
                      new Book("bbb", "BBB", "09876") 
                      });
      return books;
  }
  </code></pre>
  
  <h1>4</h1>
  
  <pre><code>@GET
  @Produces(MediaType.APPLICATION_XML)
  public Response produce() {
      List&lt;Book&gt; books = Arrays
              .asList(new Book[] { 
                      new Book("aaa", "AAA", "12345"), 
                      new Book("bbb", "BBB", "09876") 
                      });
      return Response.ok(books).build();
  }
  </code></pre>
  
  <p>Everything works in #1, #2, #3 but 4th example throws: </p>
  
  <blockquote>
    <p>Could not find MessageBodyWriter for response object of type:
    java.util.Arrays$ArrayList of media type: application/xml.</p>
  </blockquote>
  
  <p>I run it on Wildfly 9 and I wonder if it is related to RestEasy or JaxRS in general? I know that I can fix it by wrapping collection in GenericEntity, but I don't understand this inconsistent behaviour.</p>