### Question:
Error { public Object getErrorDetail() { return errorDetail; } @JsonCreator  Error(
            @JsonProperty(value = "error_code") String errorCode,
            @JsonProperty(value = "error_detail") Object errorDetail,
            @JsonProperty(value = "error_data") Object errorData
    ); String getErrorCode(); Object getErrorDetail(); Object getErrorData();  }### Answer:
@Test public void getErrorDetail() { assertSame(errorDetail, error.getErrorDetail()); }
@Test public void objectMapperPopulatesErrorDetailWhenString() throws Exception { String json = "{\"error_code\":\"Error Code\",\"error_detail\":\"Error Detail\"}"; Error error = mapper.readValue(json, Error.class); assertEquals("Error Detail", error.getErrorDetail()); }
@Test public void objectMapperPopulatesErrorDetailWhenObject() throws Exception { String json = "{\"error_code\":\"Error Code\",\"error_detail\":{\"one\":1,\"two\":2.0,\"three\":\"three\"}}"; Error error = mapper.readValue(json, Error.class); Map<Object, Object> detail = (Map<Object, Object>) error.getErrorDetail(); assertEquals(1, detail.get("one")); assertEquals(2.0, detail.get("two")); assertEquals("three", detail.get("three")); }
@Test public void objectMapperIgnoresUnknown() throws Exception { String json = "{\"error_code\":\"Error Code\",\"error_detail\":{\"one\":1,\"two\":2.0,\"three\":\"three\"},\"unknown\":null}"; Error error = mapper.readValue(json, Error.class); assertNotNull(error.getErrorDetail()); }