title: Jackson deserialize inner collection
body: <p>I have an issue with deserialization of inner collection:
  Imagine there are two classes:</p>
  
  <pre><code>// RootClass.java
  package somepackage;
  
  import com.fasterxml.jackson.databind.annotation.JsonSerialize;
  
  import java.util.ArrayList;
  import java.util.List;
  
  class RootClass {
      public List getItems() {
          return items;
      }
  
      public void setItems(List items) {
          this.items = items;
      }
  
      @JsonSerialize(contentAs = Item.class)
      List&lt;Item&gt; items = new ArrayList&lt;&gt;();
  }
  
  //Item.java
  package somepackage;
  
  class Item {
      String name;
  
      public Item() {
      }
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
      public Item(String cat) {
          name = cat;
      }
  }
  
  // main class
  package somepackage;
  
  import com.fasterxml.jackson.databind.ObjectMapper;
  
  import java.io.IOException;
  
  public class SampleCase {
      public static void main(String[] args) throws IOException {
          ObjectMapper mapper = new ObjectMapper();
          RootClass root = new RootClass();
          root.items.add(new Item("cat"));
          String json = mapper.writeValueAsString(root);
          RootClass root2 = mapper.readValue(json, RootClass.class);
          Item item = (Item) root2.items.get(0);
      }
  }
  </code></pre>
  
  <p>I get an exception:</p>
  
  <pre><code>Exception in thread "main" java.lang.ClassCastException: class java.util.LinkedHashMap cannot be cast to class somepackage.Item (java.util.LinkedHashMap is in module java.base of loader 'bootstrap'; somepackage.Item is in unnamed module of loader 'app')
  </code></pre>
  
  <p>According to javadoc <code>@JsonSerialize(contentAs = Item.class)</code> on the collection would have help me, but it wouldn't. <strong>The question is: What am i missing?</strong></p>
  
  <p>If it is not about this annotation i suspect there is a standard way to deal with the problem (i do not want to create custom deserializers).</p>
  
  <p>Most questions on collection deserialization are about situation when root object is a collection itself, but this is not the case for me.</p>
  
  <p>jackson 2.9.8
  java 11.0.2 OpenJDK x64</p>