public static <T> Pair<T, Map<String, Object>> stringToObjectAndUnrecognizedProperties(String jsonString,
      Class<T> valueType)
      throws IOException {
    T instance = DEFAULT_READER.forType(valueType).readValue(jsonString);
    Map<String, Object> inputJsonMap = flatten(DEFAULT_MAPPER.readValue(jsonString, MAP_TYPE_REFERENCE));

    String instanceJson = DEFAULT_MAPPER.writeValueAsString(instance);
    Map<String, Object> instanceJsonMap = flatten(DEFAULT_MAPPER.readValue(instanceJson, MAP_TYPE_REFERENCE));

    MapDifference<String, Object> difference = Maps.difference(inputJsonMap, instanceJsonMap);
    return Pair.of(instance, difference.entriesOnlyOnLeft());
  }
@Test
  public void testUnrecognizedJsonProperties()
      throws Exception {
    String inputJsonMissingProp = "{\"primitiveIntegerField\": 123, \"missingProp\": 567,"
        + " \"missingObjectProp\": {\"somestuff\": \"data\", \"somemorestuff\":\"moredata\"},"
        + "  \"classField\": {\"internalIntField\": 12, \"internalMissingField\": \"somedata\"}}";
    Pair<JsonUtilsTestSamplePojo, Map<String, Object>> parsedResp =
        JsonUtils.stringToObjectAndUnrecognizedProperties(inputJsonMissingProp, JsonUtilsTestSamplePojo.class);

    assertTrue(parsedResp.getRight().containsKey("/missingProp"));
    assertTrue(parsedResp.getRight().containsKey("/missingObjectProp/somestuff"));
    assertTrue(parsedResp.getRight().containsKey("/missingObjectProp/somemorestuff"));
    assertTrue(parsedResp.getRight().containsKey("/classField/internalMissingField"));
  }