@Test
public void testGetFirstHit() {

    SearchResult searchResult = new SearchResult(new Gson());
    searchResult.setSucceeded(true);
    searchResult.setJsonString(json);
    searchResult.setJsonObject(new JsonParser().parse(json).getAsJsonObject());
    searchResult.setPathToResult("hits/hits/_source");
    SearchResult.Hit hit = searchResult.getFirstHit(Object.class);
    assertNotNull(hit);
    assertNotNull(hit.source);
    assertNull(hit.explanation);
    assertNotNull(hit.sort);
    assertNotNull(hit.id);
    assertNull(hit.score);
    assertEquals(Collections.emptyList(), hit.matchedQueries);
    hit = searchResult.getFirstHit(Object.class, Object.class);
    assertNotNull(hit);
    assertNotNull(hit.source);
    assertNull(hit.explanation);
    assertNotNull(hit.sort);
    assertNotNull(hit.id);
    assertNull(hit.score);
    assertEquals(Collections.emptyList(), hit.matchedQueries);
}