title: Jackson serialise map with extra fields
body: <p>If a class extends a Map and includes some extra fields. E.G a last modified date, Jackson seems to ignore any thing not contained as a property of the map.</p>
  
  <p>I have a class that looks some thing like the following:</p>
  
  <pre><code>import java.io.IOException;
  import java.time.OffsetDateTime;
  import java.util.HashMap;
  import java.util.Objects;
  
  import com.fasterxml.jackson.databind.ObjectMapper;
  
  public class Foo extends HashMap&lt;String, String&gt; {
  
     private OffsetDateTime lastModifiedTime;
  
     public Foo() {
        super();
        lastModifiedTime = OffsetDateTime.now();
     }
  
     public void setLastModifiedTime(OffsetDateTime newTime) {
        this.lastModifiedTime = newTime;
     }
  
     public OffsetDateTime getLastModifiedTime() {
        return this.lastModifiedTime;
     }
  
     public static void main(String[] args) throws IOException {
        Foo f = new Foo();
        f.put("hello", "world");
  
        ObjectMapper om = new ObjectMapper();
        om.findAndRegisterModules();
  
        String result = om.writeValueAsString(f);
        if(f.equals(om.readValue(result, Foo.class))) {
           System.out.println("Wooo");
        } else {
           System.out.println("Booo: " + result);
        }
  
     }
  
     @Override
     public boolean equals(Object obj) {
        if (this == obj) {
           return true;
        }
        if (!(obj instanceof Foo)) {
           return false;
        }
        if (!super.equals(obj)) {
           return false;
        }
        Foo foo = (Foo) obj;
        return Objects.equals(getLastModifiedTime(), foo.getLastModifiedTime());
     }
  
     @Override
     public int hashCode() {
        return Objects.hash(super.hashCode(), getLastModifiedTime());
     }
  
  }
  </code></pre>
  
  <p>When this runs it outputs <code>booo: {"hello":"world"}</code> Which does not include the last modified date. </p>
  
  <p>I've tried adding <code>@JsonInclude</code> annotations to the property and the getters but that doesn't cause it to include the extra field. </p>
  
  <p>What is the correct way to make Jackson include this extra field?</p>