@Test
void isEmpty() {

  when(esResponse.getHits())
      .thenReturn(
          new SearchHits(
              new SearchHit[] {searchHit1, searchHit2},
              new TotalHits(2L, TotalHits.Relation.EQUAL_TO),
              1.0F));
  ElasticsearchResponse response1 = new ElasticsearchResponse(esResponse, factory);
  assertFalse(response1.isEmpty());
  when(esResponse.getHits()).thenReturn(SearchHits.empty());
  ElasticsearchResponse response2 = new ElasticsearchResponse(esResponse, factory);
  assertTrue(response2.isEmpty());
  when(esResponse.getHits())
      .thenReturn(new SearchHits(null, new TotalHits(0, TotalHits.Relation.EQUAL_TO), 0));
  ElasticsearchResponse response3 = new ElasticsearchResponse(esResponse, factory);
  assertTrue(response3.isEmpty());
}