title: jackson serializing Collections.unmodifiable*
body: <p>I have a problem using the Jackson serialization from json, how do I serialize from <code>Collections.unmodifiableMap?</code></p>
  
  <p>The error I get is:</p>
  
  <pre><code>com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of java.util.Collections$UnmodifiableMap, problem: No default constructor found
  </code></pre>
  
  <p>I wanted to use the <code>SimpleAbstractTypeResolver</code> from <a href="http://wiki.fasterxml.com/SimpleAbstractTypeResolver" rel="noreferrer">http://wiki.fasterxml.com/SimpleAbstractTypeResolver</a> however I cannot get the inner class type <code>Collections$UnmodifiableMap</code></p>
  
  <pre><code>Map&lt;Integer, String&gt; emailMap = newHashMap();
  Account testAccount = new Account();
  ObjectMapper mapper = new ObjectMapper();
  mapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL, As.PROPERTY);
  String marshalled ;
  emailMap.put(Integer.valueOf(10), "bob@mail.com");
  testAccount.setMemberEmails(emailMap);
  
  marshalled = mapper.writeValueAsString(testAccount);
  System.out.println(marshalled);
  Account returnedAccount = mapper.readValue(marshalled, Account.class);
  System.out.println(returnedAccount.containsValue("bob@mail.com"));
  
  
  public class Account {
    private Map&lt;Integer, String&gt; memberEmails = Maps.newHashMap();
  
    public void setMemberEmails(Map&lt;Integer, String&gt; memberEmails) {
      this.memberEmails = memberEmails;
    }
  
    public Map&lt;Integer, String&gt; getMemberEmails() {
      return Collections.unmodifiableMap(memberEmails);
    }
  </code></pre>
  
  <p>Any ideas? Thanks in advance.</p>