checkValid(resultWithHits);
checkJsonSerialization(resultWithHits);
// get JSON output
XContentBuilder builder = XContentFactory.jsonBuilder().prettyPrint();
builder.startObject();
resultWithHits.toXContent(builder, ToXContent.EMPTY_PARAMS);
builder.endObject();
JSONObject jsonWithHits = new JSONObject(builder.string());
Assertions.assertThat(jsonWithHits.has("hits")).isTrue();
// without hits