@Override
  public IndexMainType getMainType() {
    checkState(mainType != null, "Main type has not been defined");
    return mainType;
  }
@Test
  @UseDataProvider("indexes")
  public void getMainType_fails_with_ISE_if_createTypeMapping_with_IndexMainType_has_not_been_called(Index index) {
    NewRegularIndex newIndex = new NewRegularIndex(index, defaultSettingsConfiguration);

    assertThatThrownBy(() ->  newIndex.getMainType())
      .isInstanceOf(IllegalStateException.class)
      .hasMessage("Main type has not been defined");
  }