builder.startObject().field("test", "value").endObject();
assertThat(builder.string(), equalTo("{\"test\":\"value\"}"));
builder = XContentFactory.contentBuilder(XContentType.JSON);
builder.startObject().field("test", "value").endObject();
assertThat(builder.string(), equalTo("{\"test\":\"value\"}"));
}
@Test public void testOverloadedList() throws Exception {
XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON);
builder.startObject().field("test", Lists.newArrayList("1", "2")).endObject();