### Question:
ReplicatorDocument extends CouchDbDocument { @JsonIgnore public Map<String, Object> getUnknownFields() { return unknownFields(); }  String getSource(); void setSource(String source); String getTarget(); void setTarget(String target); @JsonProperty("create_target") Boolean getCreateTarget(); @JsonProperty("create_target") void setCreateTarget(Boolean createTarget); Boolean getContinuous(); void setContinuous(Boolean continuous); @JsonProperty("doc_ids") Collection<String> getDocumentIds(); @JsonProperty("doc_ids") void setDocumentIds(Collection<String> documentIds); String getFilter(); void setFilter(String filter); @JsonProperty("query_params") Object getQueryParameters(); @JsonProperty("query_params") void setQueryParameters(Object queryParameters); @JsonProperty("user_ctx") UserContext getUserContext(); @JsonProperty("user_ctx") void setUserContext(UserContext userContext); @JsonProperty("_replication_id") String getReplicationId(); @JsonProperty("_replication_id") void setReplicationId(String replicationId); @JsonProperty("_replication_state") String getReplicationState(); @JsonProperty("_replication_state") void setReplicationState(String replicationState); @JsonProperty("_replication_state_time") Calendar getReplicationStateTime(); @JsonProperty("_replication_state_time") void setReplicationStateTime(Calendar replicationStateTime); @JsonAnySetter void setUnknown(String key, Object value); @JsonIgnore Map<String, Object> getUnknownFields();  }### Answer:
@Test public void getUnknownFields_should_return_an_empty_map_if_there_were_no_fields_which_were_not_mapped() throws IOException { Map<String, Object> jsonMap = new HashMap<String, Object>(); jsonMap.put("_id", UUID.randomUUID().toString()); String jsonString = objectMapper.writeValueAsString(jsonMap); ReplicatorDocument document = objectMapper.readValue(jsonString, ReplicatorDocument.class); assertThat(document.getUnknownFields(), notNullValue()); assertThat(document.getUnknownFields().isEmpty(), is(true)); }
@Test public void getUnknownFields_should_return_fields_which_were_not_mapped() throws IOException { Map<String, Object> jsonMap = new HashMap<String, Object>(); String unknownField = UUID.randomUUID().toString(); jsonMap.put(unknownField, UUID.randomUUID().toString()); String jsonString = objectMapper.writeValueAsString(jsonMap); ReplicatorDocument document = objectMapper.readValue(jsonString, ReplicatorDocument.class); assertThat(document.getUnknownFields(), notNullValue()); assertThat(document.getUnknownFields().containsKey(unknownField), is(true)); assertThat(document.getUnknownFields().get(unknownField), is(jsonMap.get(unknownField))); }