### Question:
Zebra { public Zebra type(TypeEnum type) { this.type = type; return this; }  Zebra type(TypeEnum type); @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) TypeEnum getType(); void setType(TypeEnum type); Zebra className(String className); @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_CLASS_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) String getClassName(); void setClassName(String className); @JsonAnySetter Zebra putAdditionalProperty(String key, Object value); @JsonAnyGetter Map<String, Object> getAdditionalProperties(); Object getAdditionalProperty(String key); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static final String JSON_PROPERTY_TYPE; static final String JSON_PROPERTY_CLASS_NAME; }### Answer:
@Test public void typeTest() { String zebraJson = "{\"type\":\"mountain\",\"className\":\"zebra\",\"key1\":\"value1\",\"key2\":12321}"; JSON j = new JSON(); TypeFactory typeFactory = j.getMapper().getTypeFactory(); MapType mapType = typeFactory.constructMapType(HashMap.class, String.class, Object.class); try { HashMap<String, Object> map = j.getMapper().readValue(zebraJson, mapType); Assert.assertEquals(map.get("type"), "mountain"); Map<String,Object> result = j.getMapper().readValue(zebraJson, new TypeReference<Map<String,Object>>() {}); Assert.assertEquals(result.get("type"), "mountain"); } catch (Exception ex) { Assert.assertEquals(true, false); } }