title: Why I'm not able to unwrap and serialize a Java map using the Jackson Java library?
body: <p>My bean looks like this:</p>
  
  <pre><code>class MyBean {
  
      private @JsonUnwrapped HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
  
      private String name;
  
      public HashMap&lt;String, String&gt; getMap() {
          return map;
      }
  
      public void setMap(HashMap&lt;String, String&gt; map) {
          this.map = map;
      }
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  }
  </code></pre>
  
  <p>While I'm serializing the bean using the following code: </p>
  
  <pre><code>MyBean bean = new MyBean();
  HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();;
  map.put("key1", "value1");
  map.put("key2", "value2");
  bean.setMap(map);
  bean.setName("suren");
  ObjectMapper mapper = new ObjectMapper();
  System.out.println("\n"+mapper.writeValueAsString(bean));
  </code></pre>
  
  <p>I'm getting result like this:</p>
  
  <pre><code>{"map":{"key2":"value2","key1":"value1"},"name":"suren"}
  </code></pre>
  
  <p>but</p>
  
  <pre><code>{"key2":"value2","key1":"value1","name":"suren"}
  </code></pre>
  
  <p>is expected per the <a href="http://wiki.fasterxml.com/JacksonFeatureUnwrapping" rel="noreferrer">JacksonFeatureUnwrapping documentation</a>. Why am I not getting the unwrapped result?</p>