@Override
  public int hashCode() {
    int result = index.hashCode();
    result = 31 * result + indexType.hashCode();
    result = 31 * result + id.hashCode();
    return result;
  }
@Test
  public void hashcode_is_based_on_index_type_and_id() {
    String index = randomAlphabetic(5);
    String type = randomAlphabetic(6);
    String id = randomAlphabetic(7);
    DocId underTest = new DocId(index, type, id);

    assertThat(underTest.hashCode())
      .isEqualTo(new DocId(index, type, id).hashCode())
      .isNotEqualTo(new DocId(randomAlphabetic(7), type, id).hashCode())
      .isNotEqualTo(new DocId(index, type, randomAlphabetic(7)).hashCode())
      .isNotEqualTo(new DocId(index, randomAlphabetic(7), id).hashCode())
      .isNotEqualTo(new DocId(randomAlphabetic(7), randomAlphabetic(8), id).hashCode())
      .isNotEqualTo(new DocId(randomAlphabetic(7), type, randomAlphabetic(8)).hashCode())
      .isNotEqualTo(new DocId(index, randomAlphabetic(7), randomAlphabetic(8)).hashCode())
      .isNotEqualTo(new DocId(randomAlphabetic(7), randomAlphabetic(8), randomAlphabetic(9)).hashCode());
  }