.field("type", "value_type")
.startObject("inner").field("inner_field", "inner_value").endObject()
.endObject().endObject()
.copiedBytes());
assertThat(doc.rootDoc().get("type"), equalTo("value_type"));
assertThat(doc.rootDoc().get("test1"), equalTo("value1"));
assertThat(doc.rootDoc().get("test2"), equalTo("value2"));
assertThat(doc.rootDoc().get("inner.inner_field"), equalTo("inner_value"));
}