title: Deserializing fails for a class implementing Collection with Jackson
body: <p>I have the following JSON:</p>
  
  <pre><code>{
    "item": [
      { "foo": 1 },
      { "foo": 2 }
    ]
  } 
  </code></pre>
  
  <p>This is basically an object that contains a collection of items.</p>
  
  <p>So I made a class to deserialize that:</p>
  
  <pre><code>public class ItemList {
    @JsonProperty("item")
    List&lt;Item&gt; items;
  
    // Getters, setters &amp; co.
    // ...
  }
  </code></pre>
  
  <p><strong>Everything is working nicely up to this point.</strong></p>
  
  <p>Now, To make my life easier somewhere else, I decided that it would be nice to be able to iterate on the ItemList object and let it implement the Collection interface.</p>
  
  <p>So basically my class became:</p>
  
  <pre><code>public class ItemList implements Collection&lt;Item&gt;, Iterable&lt;Item&gt; {
    @JsonProperty("item")
    List&lt;Item&gt; items;
  
    // Getters, setters &amp; co.
  
    // Generated all method delegates to items. For instance:
    public Item get(int position) {
      return items.get(position);
    }
  }
  </code></pre>
  
  <p>The implementation works properly and nicely. However, the deserialization now fails. </p>
  
  <p>Looks like Jackson is getting confused:</p>
  
  <blockquote>
    <p>com.fasterxml.jackson.databind.JsonMappingException: Can not
    deserialize instance of com.example.ItemList out of START_OBJECT token</p>
  </blockquote>
  
  <p>I have tried to add <code>@JsonDeserialize(as=ItemList.class)</code> but it did not do the trick.</p>
  
  <p>What's the way to go?</p>